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

Query fast path for indexed single equality predicates

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • 20

      Using the scaffolding of SERVER-83758, we can apply a similar approach for the following queries:

      • Single field equality predicate (can be dotted path)
      • There may exist several indexes that have the field as a prefix (can be multikey), and we pick the one with the fewest number of fields
      • Limit 1 or the index has exactly one field and is unique
      • Shard filtering is not supported unless we are using the unique index described above (see SERVER-87016).
      • No projection
      • No sort
      • No numeric paths

      For queries which fit this description, we can write code to manually perform an index scan + fetch plan by directly calling into the storage APIs, removing the need to construct query execution machinery. These types of plans won't be cached as they are neither classic or SBE plans.

      We can test the effectiveness of this change by looking at the mixed_workloads_genny_rate_limited_high_value and majority_reads10_k_threads_high_value workloads.

      If we find this approach can improve the performance of these query shapes, we can incrementally remove the restrictions described above.

            Assignee:
            hana.pearlman@mongodb.com Hana Pearlman
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: