-
Notifications
You must be signed in to change notification settings - Fork 988
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
LUCENE-10555: avoid NumericLeafComparator#iteratorCost repeated initialization when NumericLeafComparator#setScorer is called #864
LUCENE-10555: avoid NumericLeafComparator#iteratorCost repeated initialization when NumericLeafComparator#setScorer is called #864
Conversation
@jpountz Hi, can you help to review this pr? thanks |
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.
FWIW this is not specific to this Elasticsearch bulk scorer, BooleanScorer
does the same thing. Your change makes sense to me, I left a minor nitpick. Can you add a CHANGES entry under 9.2?
lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java
Outdated
Show resolved
Hide resolved
* main: LUCENE-10532: remove @Slow annotation (apache#832) LUCENE-10312: Add PersianStemmer (apache#540) LUCENE-10558: Implement URL ctor to support classpath/module usage in Kuromoji and Nori dictionaries (main branch) (apache#871) LUCENE-10436: Reinstate public getdocValuesdocIdSetIterator method on DocValues (apache#869) Disable liftbot, we have our own tools LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty. (apache#860) Make CONTRIBUTING.md a bit more succinct (apache#866) LUCENE-10504: KnnGraphTester to use KnnVectorQuery (apache#796) Add change line for LUCENE-9848 LUCENE-9848 Sort HNSW graph neighbors for construction (apache#862)
@jpountz Hi, I have add the change entry. please review again, thanks |
…alization when NumericLeafComparator#setScorer is called (#864)
* main: Fix rare test failures in TestSortOptimization. fix bkd test logic error and doc error (apache#863) LUCENE-10555: avoid NumericLeafComparator#iteratorCost repeated initialization when NumericLeafComparator#setScorer is called (apache#864)
Elasticsearch use
CancellableBulkScorer
to fast cancel long time query execution by splitting one segment docs to many doc sets. When users search a topN query, for every split doc sets,TopFieldLeafCollector#setScorer
is called, thenNumericLeafComparator#setScorer
is called successively. As a result, for one segment,NumericLeafComparator#setScorer
is called many times.Every time
NumericLeafComparator#setScorer
is called, theNumericLeafComparator#iteratorCost
is reset to the Scorer.cost and will increase many unnecessarypointValues#intersect
calls to get competitive docIds. This result in performance degradationThis pr checks
NumericLeafComparator#setScorer
to be called only once for one segmentChecklist
Please review the following and check all that apply:
main
branch../gradlew check
.