From 5ed54bec92fc15009877e2d579fe59785bffdde7 Mon Sep 17 00:00:00 2001 From: Ian Boros Date: Thu, 6 Sep 2018 16:39:53 -0400 Subject: SERVER-36731 Ban object inequality and $in with unsupported values when using allPaths indexes --- src/mongo/db/query/planner_ixselect.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mongo/db/query/planner_ixselect.h') diff --git a/src/mongo/db/query/planner_ixselect.h b/src/mongo/db/query/planner_ixselect.h index e21e88b838a..01123e652b8 100644 --- a/src/mongo/db/query/planner_ixselect.h +++ b/src/mongo/db/query/planner_ixselect.h @@ -151,6 +151,17 @@ public: static std::vector expandIndexes(const stdx::unordered_set& fields, const std::vector& relevantIndices); + /** + * Check if this match expression is a leaf and is supported by an allPaths index. + */ + static bool nodeIsSupportedByAllPathsIndex(const MatchExpression* queryExpr); + + /* + * Return true if the given match expression can use a sparse index, false otherwise. This will + * not traverse the children of the given match expression. + */ + static bool nodeIsSupportedBySparseIndex(const MatchExpression* queryExpr, bool isInElemMatch); + private: /** * Used to keep track of if any $elemMatch predicates were encountered when walking a -- cgit v1.2.1