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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration

      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.

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

              Created:
              Updated: