diff options
author | Irina Yatsenko <irina.yatsenko@mongodb.com> | 2022-02-10 18:54:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-10 21:20:17 +0000 |
commit | 80224491b2f8341930d6b1f45ff935367ee2538f (patch) | |
tree | 7b33769f514a9865b3425448825fc237fecfada2 /src/mongo/db/query/planner_analysis.h | |
parent | 26292d02824c0e804eea510302019add57b6cccc (diff) | |
download | mongo-80224491b2f8341930d6b1f45ff935367ee2538f.tar.gz |
SERVER-58426 Implement $lookup planning logic
Co-authored-by: Mihai Andrei <mihai.andrei@mongodb.com>
Diffstat (limited to 'src/mongo/db/query/planner_analysis.h')
-rw-r--r-- | src/mongo/db/query/planner_analysis.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/query/planner_analysis.h b/src/mongo/db/query/planner_analysis.h index e272cae2948..9efc9419ec1 100644 --- a/src/mongo/db/query/planner_analysis.h +++ b/src/mongo/db/query/planner_analysis.h @@ -121,6 +121,20 @@ public: */ static std::unique_ptr<QuerySolution> removeProjectSimpleBelowGroup( std::unique_ptr<QuerySolution> soln); + + /** + * For the provided 'eqLookupNode', determines what join algorithm should be used to execute it + * and marks the node accordingly. In particular: + * - An indexed nested loop join is chosen if an index on the foreign collection can be used to + * answer the join predicate. + * - A hash join is chosen if disk use is allowed and if the foreign collection is sufficiently + * small. + * - A nested loop join is chosen in all other cases. + */ + static void determineLookupStrategy( + EqLookupNode* eqLookupNode, + const std::map<NamespaceString, SecondaryCollectionInfo>& collectionsInfo, + bool allowDiskUse); }; } // namespace mongo |