Skip to content

Conversation

original-brownbear
Copy link
Contributor

@original-brownbear original-brownbear commented Feb 28, 2025

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!

@original-brownbear original-brownbear added the :Data Management/Indices APIs APIs to create and manage indices and templates label Feb 28, 2025
@original-brownbear original-brownbear marked this pull request as ready for review March 3, 2025 13:06
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Mar 3, 2025
@original-brownbear original-brownbear changed the title WIP: Much faster indices lookup on metadata Much faster indices lookup on metadata Mar 3, 2025
@nielsbauman
Copy link
Contributor

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.

Copy link
Member

@dakrone dakrone left a 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.

@original-brownbear original-brownbear added the auto-backport Automatically create backport pull requests when merged label Mar 4, 2025
@original-brownbear
Copy link
Contributor Author

Thanks you two!

@original-brownbear original-brownbear merged commit 976c9f9 into elastic:main Mar 4, 2025
17 checks passed
@original-brownbear original-brownbear deleted the faster-lookup branch March 4, 2025 18:21
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 123749

georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Mar 11, 2025
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :Data Management/Indices APIs APIs to create and manage indices and templates >non-issue Team:Data Management Meta label for data/management team v8.19.0 v9.1.0

4 participants