Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7246

Can LRUQueryCache reuse DocIdSets that are created by some queries anyway?


    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Lucene Fields:


      Some queries need to create a DocIdSet to work. This is for instance the case with TermsQuery, multi-term queries, point-in-set queries and point range queries. We cache them more aggressively because these queries need to evaluate all matches on a segment before they can return a Scorer. But this can also be dangerous: if there is little reuse, then we keep converting the doc id sets that these queries create to another DocIdSet.

      This worries me a bit eg. for point range queries: they made numeric ranges faster in practice so I would not like caching to make them appear slower than they are when caching is disabled.

      So I would like to somehow bring back the optimization that we had in 1.x with DocIdSet.isCacheable so that we do not need to convert DocIdSet instances when we could just reuse existing instances.


        1. LUCENE-7246.patch
          9 kB
          Adrien Grand
        2. LUCENE-7246.patch
          9 kB
          Adrien Grand



            • Assignee:
              jpountz Adrien Grand
              jpountz Adrien Grand
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: