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

Aggregation $sort stages that get pushed down may miss opportunities to be optimized

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc0, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • v4.4
    • Query 2020-02-24, Query 2020-03-09, Query 2020-03-23, Query 2020-04-06
    • 15

      In some cases, ordering a $match in front of a $sort can require a second call to pipelineOptimize: the first call simplifies the $match, enabling the second call to recognize that the $match can be moved.

      After SERVER-7568, it's possible for a sort to get pushed into the $cursor stage before the second call to pipelineOptimize, preventing the optimization from happening.

            Assignee:
            justin.seyster@mongodb.com Justin Seyster
            Reporter:
            justin.seyster@mongodb.com Justin Seyster
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: