-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.9] Use eager loading optimization for all integer keys #28153
Conversation
What is the breaking change? Provide a detailed upgrade guide required for this change. |
Users need to declare the correct primary key type in the Example: If the primary key is a string but the |
With version 5.7.14 there where some performance optimizations for the
whereIn
method for relations (noted as "Improved eager loading performance" in the release notes).This brought a breakage for users that didn't declare the primary key type in their models. So the optimizations where limited to primary keys which are auto-incremented and declared as integer keys.
As it is OK to break things for a new version I propose to drop the auto-increment requirement and make use of the performance optimization for all integer primary keys.
Side note: at the time the
$keyType
variable was introduces it was not neccessary to set it, as it was not really used, which was probably the reason why it was not noticed in the upgrade guide. As this is a breaking change (for those who still don't know about this variable) this change should be noted in the upgrade guide (see my comment in issue 26582 ).Also see Idea 1561