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

[4.x] Update entry order and uri by ids #9350

Merged

Conversation

juliawarnke
Copy link
Contributor

@juliawarnke juliawarnke commented Jan 18, 2024

Part of #9236

Right now when saving changes in the collection tree the uri index and order index will be rebuild completely, even though the specific ids are passed as a parameter.

This causes performance issues when having a lot of entries.

This PR fixes that and updates only the affected parts.

@juliawarnke juliawarnke changed the title Update entry order and uri by ids [4.x] Update entry order and uri by ids Jan 18, 2024
Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this. Great PR!

In response to your question in the issue:

Is there a reason why the existing method updateItem in the Index class is not used?

No. I believe we started passing in the $ids in order to improve performance on the Eloquent driver, and the existing code in here just continued working. We should have done this too though.

@jasonvarga jasonvarga merged commit 63fe81e into statamic:4.x Jan 18, 2024
18 checks passed
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.

2 participants