[SERVER-53317] More efficient min/max updates for time-series Created: 09/Dec/20  Updated: 29/Oct/23  Resolved: 06/Jan/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: Backlog
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Geert Bosch Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-12-28, Execution Team 2021-01-11
Participants:

 Description   

The goal is to avoid generating $set update operations if no field in control.min or control.max is changes, and otherwise to directly generate the $set if the fields that need changes, at a level that could directly become part of an oplog entry, without using aggregation expressions.

One idea is to have something like a data structure recursively defined that contains an unordered map, a vector, and a BSONObj. If the min/max is an object, the map will be populated. If it's an array, the vector will be populated. If it's a leaf, the BSONObj is populated. Then, when BucketCatalog::commit is called, we can either construct the complete min/max object in the insert case, or the $set fields in the update case. This way, as more inserts occur, we can iterate through the document being inserted and update the current min/max without having to reconstruct the BSONObj every time.



 Comments   
Comment by Ian Whalen (Inactive) [ 07/Jan/21 ]

Author:

{'username': u'evrg-bot-webhook', 'name': u'Gregory Noma', 'email': u'gregory.noma@gmail.com'}

Message:SERVER-53317 Update time-series bucket min/max efficiently
Branch:master
https://github.com/mongodb/mongo/commit/b58f5c476af6cfd70f9aad86e1e6007e61ec93d0

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