[SERVER-58426] Add planning logic for $lookup Created: 12/Jul/21  Updated: 29/Oct/23  Resolved: 11/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Ian Boros Assignee: Mihai Andrei
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-63262 Use MultiCollection in place of Colle... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-02-07, QE 2022-02-21
Participants:

 Description   

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


 Comments   
Comment by Githook User [ 10/Feb/22 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-58426 Implement $lookup planning logic

Co-authored-by: Mihai Andrei <mihai.andrei@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/80224491b2f8341930d6b1f45ff935367ee2538f

Generated at Thu Feb 08 05:44:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.