Skip to content

Conversation

@bugmakerrrrrr
Copy link
Contributor

Description

Similar to #14672, this commit takes advantage of doc values skipper to do the dynamic pruning for SORTED(_SET) fields.

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

this.maxOrd = maxOrd;

final TwoPhaseIterator twoPhaseIterator =
new DocValuesRangeIterator(innerTwoPhase, skipper, minOrd, maxOrd, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that I've been meaning to test with numeric comparators but haven't got round to yet: I wonder if its worth replacing this usage of DocValuesRangeIterator with something that only advances to skip-block boundaries? My reasoning being that if the parent query is reasonably sparse, then calling advance() on this competitive iterator might end up doing a bunch of work to find the precise first matching value within a block that is then immediately thrown away when we leapfrog back and call advance() on the parent iterator. Whereas if we just advance to the first competitive block then we can let the parent query do the work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought. When I implemented this, I considered whether approximation could serve as a competitive iterator, but I haven't figured out when to do that.

@github-actions github-actions bot added this to the 10.4.0 milestone Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants