[ 
https://issues.apache.org/jira/browse/LUCENE-10120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17437174#comment-17437174
 ] 

Adrien Grand commented on LUCENE-10120:
---------------------------------------

Ah, thanks for the clarifications, I had misunderstood the goal. For context, 
RoaringDocIdSet optimizes for the very dense case by encoding the set of 
non-matching documents. We used to use RoaringDocIdSet all the time for 
caching, but switched back to FixedBitSet for dense sets in LUCENE-7339 
(LUCENE-7330 has slightly more context) in order to bring some performance 
back. The reason is that FixedBitSet has slightly more efficient conjunction 
logic via BitSetConjunctionDISI (which tries to emulate Lucenes former 
FilteredQuery RandomAccessFilterStrategy). So trying to optimize for the very 
dense case might bring back this space/speed trade-off where we could probably 
fit more filters in the cache, but at the expense of slightly slower querying.

bq. my understanding was that scorer.cost() gives an estimate upper bound for 
number of matched docs, and may not confirm that all docs within a range will 
match.

Your understanding is correct.

> Lazy initialize FixedBitSet in LRUQueryCache
> --------------------------------------------
>
>                 Key: LUCENE-10120
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10120
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: main (9.0)
>            Reporter: Lu Xugang
>            Priority: Major
>         Attachments: 1.png
>
>
> Basing on the implement of collecting docIds in DocsWithFieldSet, may be we 
> could do similar way to cache docIdSet in 
> *LRUQueryCache#cacheIntoBitSet(BulkScorer scorer, int maxDoc)* when docIdSet 
> is density.
> In this way , we do not always init a huge FixedBitSet which sometime is not 
> necessary when maxDoc is large
>  
>  
>  



--
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

Reply via email to