Closed kei500 closed 4 years ago
Merged. Thanks for your contribution,
Any ETA on this being released? We are having the same issue in production, and this PR resolved performance issue.
@kfalconer thanks for your additional confirmation of the improvement.
v2.1.0 is now released which contains this fix.
@westonganger
I want to stop using subquery because it sometimes causes high load of MySQL server.
For example, in my environment,
Model.reify(has_many: true)
executes SQL below:Explain of this SQL is:
As you can see,
versions
table is full scanned. The reason why index isn't used is a specification of MySQL.So, I separated this SQL into two parts.