[SERVER-63026] Make QueryPlannerParams::NO_TABLE_SCAN allow clustered index COLLSCAN Created: 26/Jan/22  Updated: 27/Oct/23  Resolved: 05/May/23

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

Type: Task Priority: Major - P3
Reporter: Haley Connelly Assignee: Milena Ivanova
Resolution: Gone away Votes: 0
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:
Case:

 Description   

Currently, QueryPlannerParams::NO_TABLE_SCAN prevents users from scanning over a clustered index via COLLSCAN. Disallowing use of the clustered index can cause a query to fail when it would have otherwise succeeded on a normal collection with the explicit _id index.

Eg) Helpers::findOne() may opt for NO_TABLE_SCAN if requireIndex=true. On a clustered collection with no other indexes, the operation fails because there are no indexes available for an IXSCAN. The clustered index goes unused. As a temporary fix, Helpers::findOne() can check if the collection is clustered, and set it to default instead if so.

Goal: A more sustainable solution in the query layer that excuses the NO_TABLE_SCAN restriction when a COLLSCAN can be performed over a clustered index.


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