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
    • Labels:
      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.

        1. image-2022-04-11-16-44-15-719.png
          65 kB
          Geert Bosch
        2. Screen Shot 2022-04-28 at 9.29.50 AM.png
          78 kB
          Yoon Soo Kim

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

              Created:
              Updated:
              Resolved: