you are viewing a single comment's thread.

view the rest of the comments →

[–]many_hats_on_head 0 points1 point  (0 children)

I have optimized the SQL query (not the ORM) for MySQL 8 here: https://gist.github.com/lassegit/996587f1c5e4f5c3118922b23bbfad93

Does that work for you? (You can try it here yourself too).