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

SBE $lookup construct incomplete index key

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      For compound index, when the first field is used in $lookup, SBE only generates index key with a single field instead of all fields

      {$lookup: {from: coll.getName(), localField: 'a', foreignField: 'a', as: 'array'} 

      The generated keys are {a: 1}, {a: 1} instead of {a: 1, b: MinKey}, {a: 1, b: MaxKey}

       

      https://github.com/10gen/mongo/blob/b5f58d8cc3853c3bdecba44bf3fdf419fa200cf8/src/mongo/db/query/sbe_stage_builder_lookup.cpp#L885

            Assignee:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Reporter:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: