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

Add SBE builder for $group accumulators

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Query Execution 2021-07-12, Query Execution 2021-07-26

      Unlike agg expressions, which are transformed from Expression* to an SBE PlanStage tree, $group accumulators will need to transformed from from an AccumulationStatement (or related type) into two sets of SBE expressions: one set for "accumulation" and another for "finalization."

      For example, $avg will be implemented with two accumulators: one for summing all of the elements and another for counting. The "finalization" expression will divide the sum by the count.

      $push on the other hand will be implemented with just an accumulator, which pushes to an array (there is no need for "finalizing").

       

            Assignee:
            eric.cox@mongodb.com Eric Cox (Inactive)
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: