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

Lookup sub-pipeline is not using index for equality match

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.6.3, 3.7.1
    • Aggregation Framework
    • None
    • MongoDB server version: 3.6.0-rc1
    • Fully Compatible
    • ALL
    • v3.6
    • Query 2017-11-13, Query 2017-12-04, Query 2017-12-18, Query 2018-01-01, Query 2018-01-15
    • 0

    Description

      I am doing following aggregation to join two collection using foreign pipeline.
      It seems match stage is not using index at all.

      db.blogpost.aggregate([
        { $lookup: { 
          from: 'comment', 
          let: { blogpost_id: "$_id" }, 
          pipeline: [ { 
             $match: { $expr: { $eq: [ "$blogpost.id", "$$blogpost_id"] } } 
          } ], 
          as: 'comments'
        }}
      ])
      

      Attachments

        Issue Links

          Activity

            People

              david.storch@mongodb.com David Storch
              naveenk Naveen
              Votes:
              4 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: