summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/classic_plan_cache.h
diff options
context:
space:
mode:
authorRuoxin Xu <ruoxin.xu@mongodb.com>2021-09-24 13:43:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-24 14:23:54 +0000
commit634867703b7eb40f073198d27633a7c5506e4604 (patch)
tree70a161bc3cb70f3f3fca99dc64f4e179320df8e2 /src/mongo/db/query/classic_plan_cache.h
parentc607f9b63f4764335749ae40a5762d6a305558c1 (diff)
downloadmongo-634867703b7eb40f073198d27633a7c5506e4604.tar.gz
SERVER-59854 Remove PlanCacheIndexabilityState from the PlanCache
This patch includes a number of changes to facilitate the use of PlanCacheIndexabilityState with SBE and classic plan cache keys. * Introduced a plan cache key factory. * Moved PlanCacheIndexabilityState from the PlanCache into CollectionQueryInfo. * Templetized QueryPlanner::planSubqueries() so it can be used with classic and SBE plan caches. * Removed dependency on the CanonicalQuery from the PlanCache class. Co-authored-by: Anton Korshunov <anton.korshunov@mongodb.com>
Diffstat (limited to 'src/mongo/db/query/classic_plan_cache.h')
-rw-r--r--src/mongo/db/query/classic_plan_cache.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/query/classic_plan_cache.h b/src/mongo/db/query/classic_plan_cache.h
index 93770fcb139..daeca87857e 100644
--- a/src/mongo/db/query/classic_plan_cache.h
+++ b/src/mongo/db/query/classic_plan_cache.h
@@ -32,9 +32,12 @@
#include <string>
#include "mongo/db/query/canonical_query.h"
+#include "mongo/db/query/canonical_query_encoder.h"
+#include "mongo/db/query/index_entry.h"
#include "mongo/db/query/plan_cache.h"
namespace mongo {
+
/**
* Represents the "key" used in the PlanCache mapping from query shape -> query plan.
*/
@@ -272,4 +275,9 @@ struct BudgetEstimator {
using PlanCache =
PlanCacheBase<PlanCacheKey, SolutionCacheData, BudgetEstimator, PlanCacheKeyHasher>;
+/**
+ * We don't want to cache every possible query. This function encapsulates the criteria for what
+ * makes a canonical query suitable for inclusion in the cache.
+ */
+bool shouldCacheQuery(const CanonicalQuery& query);
} // namespace mongo