-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query Optimization
Related ticket SERVER-54008 extends our CollectionScan node in the classic execution engine to support bounded scans, which is useful when the collection is clustered on some field. In particular, time series collections will be clustered on _id, though we could theoretically support this clustered index format for additional scenarios in the future.
Today, the query planner will always attach the full match expression as a filter on the CollectionScan, even if that predicate is expressible exactly as bounds. As an example, let's say that query rewrites result in an _internalExprGte:x predicate on the _id. This predicate could be expressed as [x, MaxKey] bounds on the CollectionScanNode, meaing that the _internalExprGte:x predicate could be removed so that it is not evaluated at runtime. We have logic to do exactly this "trimming" for predicates with exact bounds tightness when converted into regular index bounds, but we are missing such logic for bounded collection scans.
This ticket should not be done until after SERVER-54398, which will first add support to the query planner for generating bounded collscan plans.
- depends on
-
SERVER-54398 Extend query planner to generate bounded collection scan plans for time series collections
- Closed
- is related to
-
SERVER-54008 Generalize CollectionScan node so it can perform bounded scans over time series bucket collections
- Closed
- related to
-
SERVER-54969 Collection scan bounds for clustered collections should allow for exclusivity
- Backlog