jpountz commented on PR #16069:
URL: https://github.com/apache/lucene/pull/16069#issuecomment-4638145161

   FYI if you're interested in improving filtering efficiency, there's a much 
better approach than the current leap-frog intersection which preserves more 
benefits of evaluation vectorization:
   
   If the cost of the filter is less than the sum of the costs of essential 
clauses (ie. the filter leads iteration):
    - Then load filter matches over the window into a `DocAndScoreAccBuffer` 
with scores initialized to 0
    - Then apply all clauses as non-essential clauses
    - Finally drop hits from the `DocAndScoreAccBuffer` that aren't matched by 
any clause (if clauses cannot return 0 scores it's easy: just drop 0-score hits 
from the `DocAndScoreAccBuffer`, otherwise you need to track which hits are 
matched by at least one clause)
   Else:
    - Collect essential clauses as usual, into an accumulator which is then 
compressed into a `DocAndScoreAccBuffer`.
    - Then remove hits from the `DocAndScoreAccBuffer` that don't match the 
filter (similarly to what `applyRequiredClause` does)
    - Finally apply non-essential clauses (this order of operations ensures we 
don't apply non-essential clauses on hits that don't match the filter)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to