Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65465

SBE Group should not use DoubleDoubleSummation for count

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v6.0
    • QE 2022-05-02, QE 2022-05-16

      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.

            Assignee:
            yoonsoo.kim@mongodb.com Yoon Soo Kim (Inactive)
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: