diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-07-29 17:08:44 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-08-07 14:29:56 -0400 |
commit | 455b66c00bc5f885621477b63a7bfb2997ef59ae (patch) | |
tree | 5e462a40a31c3211d95c4fe91edea7a636bbe764 /src/mongo/db/exec/cached_plan.cpp | |
parent | 590f4e148ac14bda1fc1e21b4d173c3bc2d25da2 (diff) | |
download | mongo-455b66c00bc5f885621477b63a7bfb2997ef59ae.tar.gz |
SERVER-40714 Change CollectionInfoCache to be a decoration (rather than a member) on Collection object
Diffstat (limited to 'src/mongo/db/exec/cached_plan.cpp')
-rw-r--r-- | src/mongo/db/exec/cached_plan.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp index 07df67a7c77..a3e6c4d3935 100644 --- a/src/mongo/db/exec/cached_plan.cpp +++ b/src/mongo/db/exec/cached_plan.cpp @@ -40,6 +40,7 @@ #include "mongo/db/exec/multi_plan.h" #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" +#include "mongo/db/query/collection_query_info.h" #include "mongo/db/query/explain.h" #include "mongo/db/query/plan_cache.h" #include "mongo/db/query/plan_ranker.h" @@ -192,7 +193,7 @@ Status CachedPlanStage::replan(PlanYieldPolicy* yieldPolicy, bool shouldCache) { if (shouldCache) { // Deactivate the current cache entry. - PlanCache* cache = collection()->infoCache()->getPlanCache(); + PlanCache* cache = CollectionQueryInfo::get(collection()).getPlanCache(); cache->deactivate(*_canonicalQuery); } @@ -302,7 +303,7 @@ const SpecificStats* CachedPlanStage::getSpecificStats() const { void CachedPlanStage::updatePlanCache() { const double score = PlanRanker::scoreTree(getStats()->children[0].get()); - PlanCache* cache = collection()->infoCache()->getPlanCache(); + PlanCache* cache = CollectionQueryInfo::get(collection()).getPlanCache(); Status fbs = cache->feedback(*_canonicalQuery, score); if (!fbs.isOK()) { LOG(5) << _canonicalQuery->ns() << ": Failed to update cache with feedback: " << redact(fbs) |