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

Add planning logic for $lookup

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • QE 2022-02-07, QE 2022-02-21

      We must add logic to the query planner for planning a $lookup. This involves examining the size of the collections involved and choosing the join algorithm (nlj or hashed) using the heuristic we agreed on here:

       

      Foreign collection has index to answer join predicate? Size of foreign collection Strategy
      Yes Anything Indexed NLJ
      No < 10k docs Hash Join (foreign side is build side)
      No >= 10k docs NLJ

            Assignee:
            mihai.andrei@mongodb.com Mihai Andrei
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: