LUCENE-10424: Optimize the "everything matches" case for count query in PointRangeQuery#691
Merged
iverase merged 1 commit intoapache:mainfrom Feb 21, 2022
Merged
Conversation
iverase
reviewed
Feb 18, 2022
| && values.getDocCount() == values.size()) { | ||
| // if all documents have at-most one point | ||
| if (values.getDocCount() == reader.maxDoc()) { | ||
| final byte[] fieldPackedLower = values.getMinPackedValue(); |
Contributor
There was a problem hiding this comment.
Is this check really needed? I guess this will work:
if (relate(values.getMinPackedValue, values.getMaxPackedValue()) == Relation.CELL_WITHIN) {
return values.getDocCount()
}
Member
Author
There was a problem hiding this comment.
Simply and much more thoughtful!
76d6499 to
ab9c9b3
Compare
Contributor
|
Could you add an entry in CHANGES.txt? |
…in PointRangeQuery
ab9c9b3 to
2d82120
Compare
Member
Author
DONE |
Contributor
|
Thank you @LuXugang! |
wjp719
added a commit
to wjp719/lucene
that referenced
this pull request
Feb 23, 2022
* main: migrate to temurin (apache#697) LUCENE-10424: Optimize the "everything matches" case for count query in PointRangeQuery (apache#691) LUCENE-10416: Update Korean Dictionary to mecab-ko-dic-2.1.1-20180720 for Nori Remove deprecated constructors in Nori (apache#695) LUCENE-10400: revise binary dictionaries' constructor in nori (apache#693) LUCENE-10408: Fix vector values iteration bug (apache#690) Temporarily mute TestKnnVectorQuery#testRandomWithFilter LUCENE-10382: Support filtering in KnnVectorQuery (apache#656) LUCENE-10084: Rewrite DocValuesFieldExistsQuery to MatchAllDocsQuery when all docs have the field (apache#677) Add CHANGES entry for LUCENE-10398 LUCENE-10398: Add static method for getting Terms from LeafReader (apache#678) LUCENE-10408 Better encoding of doc Ids in vectors (apache#649) LUCENE-10415: FunctionScoreQuery and IndexOrDocValuesQuery delegate Weight#count. (apache#685)
wjp719
added a commit
to wjp719/lucene
that referenced
this pull request
Feb 23, 2022
* main: LUCENE-10416: move changes entry to v10.0.0 migrate to temurin (apache#697) LUCENE-10424: Optimize the "everything matches" case for count query in PointRangeQuery (apache#691) LUCENE-10416: Update Korean Dictionary to mecab-ko-dic-2.1.1-20180720 for Nori Remove deprecated constructors in Nori (apache#695) LUCENE-10400: revise binary dictionaries' constructor in nori (apache#693) LUCENE-10408: Fix vector values iteration bug (apache#690) Temporarily mute TestKnnVectorQuery#testRandomWithFilter LUCENE-10382: Support filtering in KnnVectorQuery (apache#656) LUCENE-10084: Rewrite DocValuesFieldExistsQuery to MatchAllDocsQuery when all docs have the field (apache#677) Add CHANGES entry for LUCENE-10398 LUCENE-10398: Add static method for getting Terms from LeafReader (apache#678) LUCENE-10408 Better encoding of doc Ids in vectors (apache#649) LUCENE-10415: FunctionScoreQuery and IndexOrDocValuesQuery delegate Weight#count. (apache#685)
dantuzi
pushed a commit
to SeaseLtd/lucene
that referenced
this pull request
Mar 10, 2022
…in PointRangeQuery (apache#691)
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.
In Implement of Weight#count in PointRangeQuery, Whether additional consideration is needed that when PointValues#getDocCount() == IndexReader#maxDoc() and the range's lower bound is less that the field's min value and the range's upper bound is greater than the field's max value, then return reader.maxDoc() directly?