Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-98371

Reduce allocations when estimating number of index keys of a scan using sampling

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization

      In SERVER-98115, we implemented an initial approach to sampling estimation of number of index keys of an IndexScan. It works by invoking the BTreeKeyGenerator on each document to generate the set of index keys expressed as key strings, converting each key string to BSON, and then evaluating how many keys fall in the given IndexBounds.

      We can improve the performance by avoiding unnecessary allocations of key string and BSON index keys. We can use BSONElementIterator  to iterate over all values of indexed fields in a document and perform the comparisons to the bounds to determine how many keys match.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: