[SERVER-85103] POC: store sum and count in the control field for bucket collections for insertion Created: 20/Jun/23  Updated: 12/Jan/24  Resolved: 10/Aug/23

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

Type: Task Priority: Major - P3
Reporter: Gil Alon Assignee: Alice Li (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-85053 POC: update sum and count when insert... Closed
is depended on by SERVER-85097 POC: update sum and count values for ... Closed
is depended on by SERVER-85098 POC: pushdown $group queries on sum a... Closed
Participants:

 Description   

This ticket is a POC and will not be merged into master until the performance improvements are shown. We can break this ticket up into multiple tickets if it becomes too complicated, but the steps are:

  1. Adding the new option in createCollection for users to opt in to add sum and avg in the control for bucket collections. This will involve adding a new option to the timeseries field in the createCollection command. The options are defined here.
  2. Store these sum and avg values in the control field in buckets collection. You can see where the buckets collection are defined here
  3. Update sum and avg as new documents are added in the buckets collection.

 

There are three cases where we want to modify and keep track of the sum in a document write / update: 

  1. Make a new bucket and need to set our sums to its initial values
  2. Insert into an open bucket and need to update control.sum values
  3. Update a document in our collection and therefore need to update control.sum

This ticket covers case 1. Case 3 is separated into another ticket WRITING-15235 , since updates and deletes are completed by a still ongoing project. As for case 2, this tickets covers when documents are inserted into existing open buckets. For insertions into existing closed buckets that require reopening, this is separated into ticket WRITING-15257 


Generated at Thu Feb 08 06:56:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.