[SERVER-60481] Fix perf issue with $sum accumulator in $group pushed down to SBE Created: 05/Oct/21  Updated: 29/Oct/23  Resolved: 07/Oct/21

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

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

Issue Links:
Related
related to SERVER-60289 [SBE] Improve performance of $mergeOb... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2021-10-18
Participants:

 Description   

$group accumulators keep accumulating values per each value entering a group. While accumulating, the accumulator implementation may keep allocating a new accumulated value to accumulate the new value and the previous accumulated value.

If the accumulated value is primitive type, this behavior may be ok but if the accumulated value happen to be a complex type like ArrayObject, or ArraySet, then this behavior is highly likely to hurt $group performance in SBE.

$sum is such an example.



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

Author:

{'name': 'Martin Neupauer', 'email': 'martin.neupauer@mongodb.com', 'username': 'MartinNeupauer'}

Message: SERVER-60481 Fix perf issue with $sum accumulator in $group pushed down to SBE
Branch: master
https://github.com/mongodb/mongo/commit/6f82df6d9d03173d34b1a4dc92cef977fad3e7cf

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