[SERVER-86237] Query fast path for indexed single equality predicates Created: 05/Feb/24  Updated: 07/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Hana Pearlman
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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 exists only one index that has that field as a prefix (can be multi-key)
  • Limit 1 or the index is unique
    • This allows us to delay thinking about yielding
  • No sharding
    • Shard filter is a residual filter that would require us to think about yielding
  • 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.


Generated at Thu Feb 08 06:59:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.