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

Vigya Sharma commented on LUCENE-10120:
---------------------------------------

{quote}it sounds like your proposal here is to add a new special-case to the 
LRU caching that optimizes for an extremely dense iterator, where all documents 
within a given min/max range are present (and the extreme case of this being 
where all docs match)
{quote}
Is there a way we can know this upfront, without having called collect() for 
all matching docs? The cacheImpl method uses scorer.cost() to decide between 
FixedBitSet and RoaringBitSet, but 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.

Or is the idea that we create a FixedBitSet, but discard it and instead return 
this optimized CacheAndCount implementation if all criteria are met (i.e. all 
docs within a range match). I don't know how common such queries are, but it 
could be quite a space saver when doc count is high.

> 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