[SERVER-60289] [SBE] Improve performance of $mergeObjects when used with $group Created: 28/Sep/21  Updated: 29/Oct/23  Resolved: 26/Oct/21

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

Type: Task Priority: Major - P3
Reporter: Yoon Soo Kim Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-60481 Fix perf issue with $sum accumulator ... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2021-10-18, QE 2021-11-01
Participants:

 Description   

When an accumulator operator is used with $group, the engine performs an accumulation process that processes each input value and updates/maintains "accumulator state" for each group. For each value processed, the current SBE implementation of the $mergeObjects operator will always update the accumulator state by allocating a new object rather than modifying the current existing object held in the accumulator state. This hurts the performance of the $mergeObjects operator in SBE.

The goal of this task is to improve the SBE implementation of $mergeObjects to avoid allocating a new object each time it processes a value.

 



 Comments   
Comment by Githook User [ 26/Oct/21 ]

Author:

{'name': 'Bobby Morck', 'email': 'bobby.morck@mongodb.com', 'username': 'bmorck'}

Message: SERVER-60289 Optimizing mergeObjects with setField and owned accumulator
Branch: master
https://github.com/mongodb/mongo/commit/e4049ec2cbff7dd8f704b551d4b598951c9a08b6

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