[SERVER-65465] SBE Group should not use DoubleDoubleSummation for count Created: 11/Apr/22  Updated: 29/Oct/23  Resolved: 04/May/22

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

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

Attachments: PNG File Screen Shot 2022-04-28 at 9.29.50 AM.png     PNG File image-2022-04-11-16-44-15-719.png    
Issue Links:
Backports
Gantt Dependency
has to be done after SERVER-64227 Remove $sum/$avg merging logic which ... Closed
Related
related to SERVER-67282 $add expression should not use Double... Closed
related to SERVER-77203 Classic Group should not use DoubleDo... In Code Review
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0
Sprint: QE 2022-05-02, QE 2022-05-16
Participants:

 Description   

I was surprised to see the following:

when profiling

db.products.aggregate([{$group:{_id:'$type', count: {$sum:1}}}], {hint:{'$natural':1}})

Because we just summing the constant 1, there is no need for compensated summation: we should just count using a 64-bit integer. It won't overflow.



 Comments   
Comment by Githook User [ 04/May/22 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-65465 Have the SBE $sum use a simple `sum` for a count-like sum
Branch: master
https://github.com/mongodb/mongo/commit/25c0fbade9ec93a3c5458fc5c7d2481adad064c7

Comment by Geert Bosch [ 26/Apr/22 ]

This may actually be addressed by SERVER-65735.

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