Repository navigation
[6.x] Write each index once when a structured collection is reordered - #15888
Merged
jasonvarga merged 1 commit intoNov 13, 2026
Merged
Conversation
Reordering a collection's tree, or changing a page that has children, updates the order, parent and uri indexes for each entry affected, and each update wrote the whole index. They are all put first now and the index is written once. An index class with its own updateItem() is still called for each.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reordering a structured collection writes the
orderandparentindexes once for every entry whose position changed.CollectionEntriesStore::updateEntriesWithinIndex()callsIndex::updateItem()for each affected entry, and each call loads the index, sets one value and writes the whole index back to the cache. Dragging the first item of a long list to the end changes the order of every entry, so a 2,000 entry collection does 4,000 writes of a 2,000 item index to move one row.This adds
Index::updateItems(), which loads the index once, sets every item and writes it once.updateEntriesWithinIndex()uses it. An index class that has its ownupdateItem()still has it called for each item, so custom indexes behave as they did.Numbers
Dragging the first entry of a structured collection to the end, timed in a fresh process, flat-file Stache in the file cache:
The contents of the indexes afterwards are the same as before.
Tests
The order and parent indexes are each written once for a reorder touching several entries, hold the same values as before, and an index with its own
updateItem()still has it used. Two of the four fail without the change.