-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Speed up stored field spec management #122645
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
Conversation
When you load stored fields from lucene you have get all of your ducks in a row first or it'll be really slow. You need to get a list of all of the fields you want so you can ignore the ones that you don't. We do this with the `StoredFieldsSpec` which is immutable and has a `merge` method. It's quite common to merge a few dozen of these specs together to prepare for the fetch phase or for a new segment when loading fields from ESQL. When I was loading thousands of fields in ESQL I noticed that the merge was slowing things down marginally. This skips a big chunk of the merge in the common case that we don't have to load any named stored fields.
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
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.
would you mind adding a comment to explain that new conditional ? Do we need tests to make sure this optimizations sticks around?
Yeah. I'll do both. |
💚 Backport successful
|
When you load stored fields from lucene you have get all of your ducks in a row first or it'll be really slow. You need to get a list of all of the fields you want so you can ignore the ones that you don't. We do this with the `StoredFieldsSpec` which is immutable and has a `merge` method. It's quite common to merge a few dozen of these specs together to prepare for the fetch phase or for a new segment when loading fields from ESQL. When I was loading thousands of fields in ESQL I noticed that the merge was slowing things down marginally. This skips a big chunk of the merge in the common case that we don't have to load any named stored fields.
When you load stored fields from lucene you have get all of your ducks in a row first or it'll be really slow. You need to get a list of all of the fields you want so you can ignore the ones that you don't. We do this with the `StoredFieldsSpec` which is immutable and has a `merge` method. It's quite common to merge a few dozen of these specs together to prepare for the fetch phase or for a new segment when loading fields from ESQL. When I was loading thousands of fields in ESQL I noticed that the merge was slowing things down marginally. This skips a big chunk of the merge in the common case that we don't have to load any named stored fields.
When you load stored fields from lucene you have get all of your ducks in a row first or it'll be really slow. You need to get a list of all of the fields you want so you can ignore the ones that you don't. We do this with the `StoredFieldsSpec` which is immutable and has a `merge` method. It's quite common to merge a few dozen of these specs together to prepare for the fetch phase or for a new segment when loading fields from ESQL. When I was loading thousands of fields in ESQL I noticed that the merge was slowing things down marginally. This skips a big chunk of the merge in the common case that we don't have to load any named stored fields.
When you load stored fields from lucene you have get all of your ducks in a row first or it'll be really slow. You need to get a list of all of the fields you want so you can ignore the ones that you don't. We do this with the
StoredFieldsSpecwhich is immutable and has amergemethod. It's quite common to merge a few dozen of these specs together to prepare for the fetch phase or for a new segment when loading fields from ESQL.When I was loading thousands of fields in ESQL I noticed that the merge was slowing things down marginally. This skips a big chunk of the merge in the common case that we don't have to load any named stored fields.