You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
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 existing users and this breakage was fixed by workarounds with #26622 and further with #26688.
protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& $model->getIncrementing()
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw' // <- the method name optimized for integers
: 'whereIn';
}
My proposal is to remove the check to $model->getIncrementing() and use the optimization also for integer keys that are not marked for auto incrementation.
As this is a breaking change it should be done for the next big release (5.9 or 6.0) and thus also needs to be documented in the upgrade guide.
The text was updated successfully, but these errors were encountered:
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 existing users and this breakage was fixed by workarounds with #26622 and further with #26688.
Currently this workaround uses the optimization and stays compatible with existing apps, by doing the following checking (in Illuminate\Database\Eloquent\Relations\Relation line 320):
My proposal is to remove the check to
$model->getIncrementing()
and use the optimization also for integer keys that are not marked for auto incrementation.As this is a breaking change it should be done for the next big release (5.9 or 6.0) and thus also needs to be documented in the upgrade guide.
The text was updated successfully, but these errors were encountered: