[ https://issues.apache.org/jira/browse/LUCENE-9584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17220608#comment-17220608 ]
hackerwin7 edited comment on LUCENE-9584 at 10/27/20, 4:12 AM: --------------------------------------------------------------- I upload a patch based for 7.7.0, just check the result iterator before new ConstantScoreScorer; but I'm not sure should we use return null to terminate more early in BooleanWeight.scorerSupplier() just let the subScorer == null. I believe that in PointInSetQuery.scorer() reader.getPointValues(field) == null *is equal to* reader intersected result is empty this two case should both return null to terminate more early. was (Author: hackerwin7): I upload a patch based for 7.7.0, just check the result iterator before new ConstantScoreScorer; but I'm not sure should we use return null to terminate more early in BooleanWeight.scorerSupplier() just let the subScorer == null > PointInSetQuery does not terminate early if result iterator has no docs > ----------------------------------------------------------------------- > > Key: LUCENE-9584 > URL: https://issues.apache.org/jira/browse/LUCENE-9584 > Project: Lucene - Core > Issue Type: Improvement > Components: core/search > Affects Versions: 7.7.3, 8.6.3 > Reporter: hackerwin7 > Priority: Major > Labels: performance > Attachments: LUCENE-7.7.0-PointInSetQuery_terminate_early.patch > > > Today, in a point in set query after BKD intersect we get a DocIdSetBuilder > result, if result's iterator have no docs, then the PointInSetQuery still > create ConstantScoreScorer with an empty DocIdSetIterator. > In a Boolean Query, such as query = subQuery1 AND subQuery2 AND subQuery3 > .... subQueryN > if subQuery1 is a PointInSetQuery and get a empty result iterator, and > subsequent subQuery2 ~ subQueryN would still evaluate to call build scorer, > this is an unnecessary cost for this query. > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org