-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Further simplify SingleValueMatchQuery #136195
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
Further simplify SingleValueMatchQuery #136195
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Hi @romseygeek, I've created a changelog YAML for you. |
|
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. |
dnhatn
left a comment
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.
👍 Thanks Alan!
martijnvg
left a comment
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.
nice simplification 👍
|
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
|
I've updated this to pull doc values directly for the fields, rather than trying to re-use FieldData. |
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.
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.