[SERVER-84537] Use constant $sum optimization outside of $group Created: 03/Jan/24  Updated: 30/Jan/24

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

Type: Improvement Priority: Major - P3
Reporter: Mihai Andrei Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

Following SERVER-77203 and SERVER-65465, $sum over a constant will use a simple sum instead of a DoubleDoubleSummation to track the sum in both classic and SBE. However, this optimization is only used in $group. This ticket tracks the work to use this optimization in other places, including: 

  • Window functions 
  • $bucketAuto (which default constructs a $sum accumulator, and does not use this optimization)
  • Anywhere that we default construct AccumulatorSum

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