[SERVER-45823] Allow multikey index scans to be exploded for sorts Created: 28/Jan/20  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-31898 Improve sort analysis to allow multik... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

Currently the planner prevents exploding an index to provide a sort when the sort is on a multikey field. See here.

Conceptually there's no reason we must enforce this restriction. Under certain conditions described in SERVER-31898 we can actually use an index to provide a sort on a multikey field.

One way to implement this optimization is to change explodeForScan to return a success/fail indicator. After this function builds the index scan node which has point bounds on the first components we can use the existing logic in IndexScanNode to determine whether the sort is actually provided. See here.


Generated at Thu Feb 08 05:09:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.