[ https://issues.apache.org/jira/browse/LUCENE-10120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438717#comment-17438717 ]
Greg Miller commented on LUCENE-10120: -------------------------------------- I certainly agree with the idea of not adding more implementations here if it's not serving a clear purpose, but in this case, I think there might be a good reason. We're using "roaring" as the general solution today but switch to "fixed" in cases where the "cost" estimate provided by the scorer indicates very high density. The "fixed" solution provides random access to the underlying docs, which is leveraged when these cached queries get conjunctively combined in a boolean query (see [code|https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/ConjunctionDISI.java#L237] and LUCENE-7339). This newly proposed implementation uses a much more memory-efficient representation of a contiguous range of docs, while also being able to support random access to the underlying bits (which I'd missed in my quick patch proposal but [~ChrisLu] included in the latest PR). I'm not sure how often these "contiguous" cases will occur, but I could imagine realistic scenarios -- particularly when terms match all docs. I also think we could come up with a pretty clean implementation here that's shared with {{DocsWithFieldSet}} given that it's essentially the same thing. > 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 (10.0) > Reporter: Lu Xugang > Priority: Major > Attachments: 1.png, LUCENE-10120.patch > > Time Spent: 2h 50m > Remaining Estimate: 0h > > 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