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

reorder $limit before $lookup in pipeline

    • Fully Compatible
    • Query 2019-12-16, Query 2019-12-30

      In pipeline:

      [ ... {$lookup:{}}, {$addFields:{}}, {$lookup:{}}, {$limit:10}, ... ]
      

      moving $limit before the first $lookup stage will significantly reduce the amount of work that lookup and addFields have to do. We currently don't reorder $limit with $lookup, it appears.

            Assignee:
            katherine.wu@mongodb.com Katherine Wu (Inactive)
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            1 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: