[ 
https://issues.apache.org/jira/browse/LUCENE-7421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adrien Grand closed LUCENE-7421.
--------------------------------
    Resolution: Won't Fix

Hmm actually it helps less (only 2-3%) when the boolean query is nested under a 
conjunction (which is typically how BS2 gets used), so this is probably not 
that interesting.

{noformat}
         AndMedOrHighLow       22.62      (2.3%)       23.24      (2.3%)    
2.7% (  -1% -    7%)
{noformat}

> Speed up BS2 by caching the 2nd lowest doc id in the priority queue
> -------------------------------------------------------------------
>
>                 Key: LUCENE-7421
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7421
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-7421.patch
>
>
> BS2 uses a priority queue in order to merge several sorted iterators into a 
> new sorted iterator. We call updateTop every time that we move the 'top' 
> iterator forward, which requires to check the size of the priority queue at 
> least twice and perform at least two comparisons of doc ids.
> Instead, DisjunctionSumScorer could cache the 2nd lowest doc id of the 
> priority queue and only call updateTop when the doc id of the entry at the 
> top of the priority queue goes beyong the 2nd lowest doc id. While this would 
> involve slightly more work in the case that the PQ has two high-cardinality 
> clauses whose docs are interleaved, this would help when one clause has a 
> much higher cardinality than the other ones or when the doc ids of the 
> various clauses are clustered.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to