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

Relax the sorting requirement for enabling streaming group on timeseries aggregations.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Integration

    Description

      Currently, streaming $group is only enabled when the user provides a $sort stage on the _id field of the $group. Most accumulators do not have different outputs depending on the order of the input documents.

      When the $group doesn't depend on the ordering of input documents and the group stage groups on time, we can insert a $sort stage to reorder documents and enable streaming $group.

      As part of this ticket,
      1. Investigate which accumulators do depend on document ordering (at least $firstN and $lastN)
      2. Add code to DocumentSourceInternalUnpackBucket::doOptimizeAt() directly before the call to enableStreamingGroupIfPossible() that will insert a $sort stage on the timeField before the new streaming group stage.

      Attachments

        Activity

          People

            backlog-query-integration Backlog - Query Integration
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: