Skip to content
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

Fix High CPU Usage #2840

Merged
merged 1 commit into from Mar 15, 2022
Merged

Fix High CPU Usage #2840

merged 1 commit into from Mar 15, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 14, 2022

I think not needed execute this query for all rows, can execute for only model related rows.

Ref:
https://github.com/spatie/eloquent-sortable#grouping

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Have 4 million rows in our media table and this query takes over than 5 seconds on 10 Core CPU server.
And CPU is using %300 on during crowded hours.

I think not needed execute this query for all rows, can execute for only model related rows.
@freekmurze freekmurze merged commit 97c08aa into spatie:main Mar 15, 2022
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant