Add planning logic for $lookup

XMLWordPrintableJSON

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

      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
              Reporter:
              Ian Boros
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: