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

Implement O(1) count on query cache

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None
    • New

    Description

      I'd like to implement the `Weight#count` method in `LRUQueryCache` so cached queries can quickly return their counts. We already have a count on all of the bit sets we use for the query cache we just have to store it and "plug it in".

       

      I got here because we frequently end up wanting to get counts and I saw hot `RoaringDocIdSet`'s iterator hot spotting. I don't think it's slow or anything, but when the collector is just `count++` the iterator is substantial. It seems like we could frequently avoid the whole thing by implementing `count` in the query cache.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nik9000 Nik Everett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m