Further simplify SingleValueMatchQuery#136195
Merged
romseygeek merged 11 commits intoelastic:mainfrom Oct 16, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Hi @romseygeek, I've created a changelog YAML for you. |
Contributor
Author
|
Our SortedBinaryDocValues class doesn't extend DocIdSetIterator, but I don't think it would be much work to make it do so and we could then get a speedup for that case too. |
romseygeek
commented
Oct 8, 2025
Contributor
Author
|
Hmpf, it appears that Ordinals don't implement docId() either, so this will need to be restricted to just numerics. |
…on' into esql/single-value-optimization
Contributor
Author
|
I've updated this to pull doc values directly for the fields, rather than trying to re-use FieldData. |
Kubik42
pushed a commit
to Kubik42/elasticsearch
that referenced
this pull request
Oct 16, 2025
Rather than doing a two-phase iterator dance with advanceExact, we can use the fact that doc values iterators all extend DocIdSetIterator and reuse DocIdSetIteratorScorerSupplier if we know there are no multi-valued fields in a segment. We can also automatically rewrite to a MatchAllDocsQuery if the input FieldData is a constant value.
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.
Rather than doing a two-phase iterator dance with
advanceExact, we canuse the fact that doc values iterators all extend DocIdSetIterator and reuse
DocIdSetIteratorScorerSupplier if we know there are no multi-valued fields
in a segment.
We can also automatically rewrite to a MatchAllDocsQuery if the input
FieldData is a constant value.