diff options
Diffstat (limited to 'src/mongo/db/query/explain.cpp')
-rw-r--r-- | src/mongo/db/query/explain.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp index 92586ac1c47..95b07d91c68 100644 --- a/src/mongo/db/query/explain.cpp +++ b/src/mongo/db/query/explain.cpp @@ -45,7 +45,6 @@ #include "mongo/db/exec/text.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/db/keypattern.h" -#include "mongo/db/query/canonical_query_encoder.h" #include "mongo/db/query/get_executor.h" #include "mongo/db/query/plan_executor.h" #include "mongo/db/query/plan_summary_stats.h" @@ -646,17 +645,13 @@ void Explain::generatePlannerInfo(PlanExecutor* exec, // field will always be false in the case of EOF or idhack plans. bool indexFilterSet = false; boost::optional<uint32_t> queryHash; - boost::optional<uint32_t> planCacheKeyHash; if (collection && exec->getCanonicalQuery()) { const CollectionInfoCache* infoCache = collection->infoCache(); const QuerySettings* querySettings = infoCache->getQuerySettings(); PlanCacheKey planCacheKey = infoCache->getPlanCache()->computeKey(*exec->getCanonicalQuery()); - planCacheKeyHash = canonical_query_encoder::computeHash(planCacheKey.toString()); - queryHash = canonical_query_encoder::computeHash(planCacheKey.getStableKeyStringData()); - - if (auto allowedIndicesFilter = - querySettings->getAllowedIndicesFilter(planCacheKey.getStableKey())) { + queryHash = PlanCache::computeQueryHash(planCacheKey); + if (auto allowedIndicesFilter = querySettings->getAllowedIndicesFilter(planCacheKey)) { // Found an index filter set on the query shape. indexFilterSet = true; } @@ -680,10 +675,6 @@ void Explain::generatePlannerInfo(PlanExecutor* exec, plannerBob.append("queryHash", unsignedIntToFixedLengthHex(*queryHash)); } - if (planCacheKeyHash) { - plannerBob.append("planCacheKey", unsignedIntToFixedLengthHex(*planCacheKeyHash)); - } - BSONObjBuilder winningPlanBob(plannerBob.subobjStart("winningPlan")); const auto winnerStats = getWinningPlanStatsTree(exec); statsToBSON(*winnerStats.get(), &winningPlanBob, ExplainOptions::Verbosity::kQueryPlanner); @@ -1008,7 +999,6 @@ void Explain::planCacheEntryToBSON(const PlanCacheEntry& entry, BSONObjBuilder* } shapeBuilder.doneFast(); out->append("queryHash", unsignedIntToFixedLengthHex(entry.queryHash)); - out->append("planCacheKey", unsignedIntToFixedLengthHex(entry.planCacheKey)); // Append whether or not the entry is active. out->append("isActive", entry.isActive); |