-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fixed unaccepted assets report memory exhaustion bug, Optimized query #16036
base: develop
Are you sure you want to change the base?
Fixed unaccepted assets report memory exhaustion bug, Optimized query #16036
Conversation
PR Summary
|
$query->morphWith([ | ||
AssetModel::class => ['model'], | ||
Company::class => ['company'], | ||
Asset::class => ['assignedTo'], | ||
])->with('model.category'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had a chance to check this out yet but want to note that morphWith
is the documented way to eager load morphTo relationships. It looks weird but we landed on that while pairing.
Optimized the unaccepted asset reports query slightly. Should fix the memory exhaustion issue. but there is room for improvement with the amount of models loaded.