News for hackers. Stuff that matters.
Re:Using Nested Selects for Performance in Rails by kenn on Friday July 10, 2015 @06:01AM (#9863086)
It would be slow on MySQL, though.

If you EXPLAIN that query, it's a DEPENDENT SUBQUERY which has to fetch N*M records. It would be mitigated if the columns are property indexed, but two separate queries (N+M) just as eager loading would be faster and more predictable than nested scans in terms of IOPS.

There are no comments on this comment yet.