-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Query Optimization
-
(copied to CRM)
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.