jpountz opened a new pull request, #12490: URL: https://github.com/apache/lucene/pull/12490
`ImpactsDISI` is nice: you give it an `ImpactsEnum`, typically coming from the `PostingsFormat` and it will automatically skip hits whose score cannot be greater than the minimum competitive score. This is the class that yields 10x or more speedups on top-level `TermQuery`s compared to exhaustive evaluation. However, when nested under a disjunction or a conjunction, `ImpactsDISI` typically adds more overhead than it enables skipping. The reason is that on a disjunction `a OR b`, the minimum competitive score of `a` is the minimum score for the disjunction minus the maximum score of `b`. While this sort of propagation of minimum competitive scores down the query tree sometimes helps, it does hurt more than it helps on average, because `ImpactsDISI` adds quite some overhead and the per-clauses minimum scores are usually so low that they don't actually enable skipping hits. I looked into reducing this overhead, but a big part of it is the additional virtual call, so the only way to get rid of this overhead is to not wrap with an `ImpactsDISI` at all. This means that scorers need a way to know whether they are producing the top-level score, or whether they are producing a partial score that then gets combined into the top-level score. Term queries would then only wrap with `ImpactsDISI` when they produce the top-level score. Note that this does not only include top-level term queries, but also conjunctions that have a single scoring clause (`a #b`) or combinations of a term query and one or more prohibited clauses (`a -b`). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org