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

Optimize pipelines with $sort after $setWindowFields where possible

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query Optimization 2021-04-05, Query Optimization 2021-04-19, Query Optimization 2021-05-03, Query Optimization 2021-05-17

      Description

      Semantically, the $setWindowFields stage does not guarantee an output order so users may add a $sort stage to get the order they want. Since the physical implementation for $setWindowFields happens to have a guaranteed order, we should drop (or coalesce or swap) the user $sort if its not necessary.

        Attachments

          Activity

            People

            Assignee:
            david.percy David Percy
            Reporter:
            nicholas.zolnierz Nicholas Zolnierz
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: