diff options
Diffstat (limited to 'src/mongo/db/query/sbe_sub_planner.cpp')
-rw-r--r-- | src/mongo/db/query/sbe_sub_planner.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/query/sbe_sub_planner.cpp b/src/mongo/db/query/sbe_sub_planner.cpp index e5e714ad3aa..c6ce37cb434 100644 --- a/src/mongo/db/query/sbe_sub_planner.cpp +++ b/src/mongo/db/query/sbe_sub_planner.cpp @@ -116,8 +116,9 @@ CandidatePlans SubPlanner::plan( // TODO SERVER-61507: do it unconditionally when $group pushdown is integrated with the SBE plan // cache. - if (_cq.pipeline().empty()) { - plan_cache_util::updatePlanCache(_opCtx, mainColl, _cq, *compositeSolution, *root, data); + if (canonical_query_encoder::canUseSbePlanCache(_cq)) { + plan_cache_util::updatePlanCache( + _opCtx, _collections, _cq, *compositeSolution, *root, data); } return {makeVector(plan_ranker::CandidatePlan{ |