[SERVER-31776] $avg pipeline accumulator may overflow Created: 31/Oct/17 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Simon | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Sprint: | Query 2020-08-24 |
| Participants: |
| Description |
|
The $avg pipeline group accumulator computes the average by summing all elements then divide by the count. src/mongo/db/pipeline/accumulator_avg.cpp :
This may lead to an overflow in the sum for large number of records or large numbers. To be evaluated for performance reasons : using a stream-average to compute the average.
|
| Comments |
| Comment by Ramon Fernandez Marina [ 31/Oct/17 ] |
|
Thanks for your detailed report Uyttendaele, I've sent it to the Query team for investigation. |