[SERVER-81135] Do not create a separate window for each init expression Created: 18/Sep/23  Updated: 29/Oct/23  Resolved: 25/Sep/23

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

Type: Bug Priority: Major - P3
Reporter: Foteini Alvanaki Assignee: Foteini Alvanaki
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-81134 17% increase in Latency after adding ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2023-09-18
Participants:
Linked BF Score: 135

 Description   

We have implemented $avg as a combination of two accumulators, sum and count. We track the two accumulators separately and combine them at the end to compute the avg. The investigation showed that the maintenance of two separate accumulators is causing the regression. I believe the reason is that we treat each accumulator as a different window evaluating each document against the window boundaries twice.



 Comments   
Comment by Githook User [ 22/Sep/23 ]

Author:

{'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}

Message: SERVER-81135 Do not create a separate window for each init expression
Branch: master
https://github.com/mongodb/mongo/commit/90019c13bef324a48ca83153962dad0fd2b97870

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