diff options
author | Rui Liu <rui.liu@mongodb.com> | 2022-06-22 09:52:36 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-22 10:42:32 +0000 |
commit | 2c2d85e73d0620d779544ce67218db171c154e8b (patch) | |
tree | c6172fde4fb0500c2254ceaf9cd92ac14c8b128d /src/mongo/db/exec/plan_cache_util.cpp | |
parent | ad2b9ae23ad19f871f2033dc338c96ad9aa8d161 (diff) | |
download | mongo-2c2d85e73d0620d779544ce67218db171c154e8b.tar.gz |
SERVER-64432 Integrate SBE plan cache for $lookup
Diffstat (limited to 'src/mongo/db/exec/plan_cache_util.cpp')
-rw-r--r-- | src/mongo/db/exec/plan_cache_util.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/exec/plan_cache_util.cpp b/src/mongo/db/exec/plan_cache_util.cpp index 85d5c823849..a3fc5ff19d1 100644 --- a/src/mongo/db/exec/plan_cache_util.cpp +++ b/src/mongo/db/exec/plan_cache_util.cpp @@ -74,17 +74,17 @@ void logNotCachingNoData(std::string&& solution) { } // namespace log_detail void updatePlanCache(OperationContext* opCtx, - const CollectionPtr& collection, + const MultipleCollectionAccessor& collections, const CanonicalQuery& query, const QuerySolution& solution, const sbe::PlanStage& root, const stage_builder::PlanStageData& data) { - // TODO SERVER-61507: Integration between lowering parts of aggregation pipeline into the find - // subsystem and the new SBE cache isn't implemented yet. Remove cq->pipeline().empty() check - // once it's implemented. - if (shouldCacheQuery(query) && collection && query.pipeline().empty() && + // TODO SERVER-61507: Remove canUseSbePlanCache check once $group pushdown is + // integrated with SBE plan cache. + if (shouldCacheQuery(query) && collections.getMainCollection() && + canonical_query_encoder::canUseSbePlanCache(query) && feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV()) { - auto key = plan_cache_key_factory::make<sbe::PlanCacheKey>(query, collection); + auto key = plan_cache_key_factory::make(query, collections); auto plan = std::make_unique<sbe::CachedSbePlan>(root.clone(), data); plan->indexFilterApplied = solution.indexFilterApplied; sbe::getPlanCache(opCtx).setPinned( |