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

reorder $limit before $lookup in pipeline

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: