[SERVER-55106] Map predicates on max time to a portion of _id Created: 09/Mar/21  Updated: 29/Oct/23  Resolved: 13/Apr/21

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

Type: Task Priority: Major - P3
Reporter: Jacob Evans Assignee: Jacob Evans
Resolution: Fixed Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-54398 Extend query planner to generate boun... Closed
related to SERVER-55576 Optimize queries on time-series colle... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Optimization 2021-03-22, Query Optimization 2021-04-05, Query Optimization 2021-04-19
Participants:

 Description   

As part of the time-series schema, min time is embedded into _id. We can add the max bucket range to this to get an overestimate for max time. In addition to using the control.max.time field, we should map max time predicates to predicates on time to the min time portion of _id plus the bucket range. The 'plus' can be realized by subtracting from the user-provided predicate value in the query but we should guard against underflow. This should lead to guaranteed index utilization. This should be done inside $unpackBucket's doOptimizeAt() for $eq, $gt, $lt, $gte, $lte only.



 Comments   
Comment by Githook User [ 13/Apr/21 ]

Author:

{'name': 'Jacob Evans', 'email': 'jacob.evans@10gen.com'}

Message: SERVER-55106 Map predicates on max time to _id for time-series
Branch: master
https://github.com/mongodb/mongo/commit/6aa35bca9f588173287774b017c7aaf287ed1b61

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