-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Much faster indices lookup on metadata #123749
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
Much faster indices lookup on metadata #123749
Conversation
server/src/main/java/org/elasticsearch/cluster/metadata/ProjectMetadata.java
Outdated
Show resolved
Hide resolved
Pinging @elastic/es-data-management (Team:Data Management) |
This LGTM, but since I was there when we made these changes, I'd prefer if someone else had a look as well. I'll ask someone from Data Management to have a look. |
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.
LGTM also, thanks for the helpful comment.
Thanks you two! |
💔 Backport failed
You can use sqren/backport to manually backport by running |
We mostly need the map for lookups in very tight loops but also rarely rely on the sortedness of this thing. Getting the best of both worlds at surprisingly only a ~10% increase in build time and ~25% increase in the heap consumption of this structure provides a massive speedup to e.g. search or field_caps over large numbers of indices thanks to the up to an order of magnitude cheaper lookups in index name resolution and security (as well as speedups in other areas).
We mostly need the map for lookups in very tight loops but also rarely rely on the sortedness of this thing. Getting the best of both worlds at surprisingly only a ~10% increase in build time and ~25% increase in the heap consumption of this structure provides a massive speedup to e.g. search or field_caps over large numbers of indices thanks to the up to an order of magnitude cheaper lookups in index name resolution and security (as well as speedups in other areas).
Credit to @nielsbauman for finding that the tree lookups are still such a big issue and finding a solution here with me!