[SERVER-54715] Trim predicates off CollectionScanNode if they are expressible directly as bounds on RecordStore's primary key Created: 22/Feb/21  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: David Storch Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-54398 Extend query planner to generate boun... Closed
Related
related to SERVER-54969 Collection scan bounds for clustered ... Backlog
is related to SERVER-54008 Generalize CollectionScan node so it ... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

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.


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