[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: |
|
||||||||||||
| 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: |