From bd0cdbf21d2e91a4b63db6d092378a86f058c73d Mon Sep 17 00:00:00 2001 From: Hari Khalsa Date: Thu, 1 Aug 2013 11:01:23 -0400 Subject: SERVER-10376 SERVER-10026 end-to-end part 1: run non-indexed queries --- src/mongo/db/query/query_planner.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/query/query_planner.h') diff --git a/src/mongo/db/query/query_planner.h b/src/mongo/db/query/query_planner.h index beec11f136c..dcfc5ecf9d2 100644 --- a/src/mongo/db/query/query_planner.h +++ b/src/mongo/db/query/query_planner.h @@ -16,6 +16,7 @@ #pragma once +#include "mongo/db/query/canonical_query.h" #include "mongo/db/query/query_solution.h" namespace mongo { @@ -32,8 +33,18 @@ namespace mongo { * * Caller owns the pointers in *out. */ - static void plan(const CanonicalQuery& query, vector *out) { - } + static void plan(const CanonicalQuery& query, vector* out); + + private: + /** + * Returns true if the tree rooted at 'node' requires an index to answer the query. There + * is a default solution for every plan that is a collection scan + a filter for the full + * query. We can use this default solution when the query doesn't require an index. + * + * TODO: When we create plans with indices, we'll want to know which nodes require an index + * and what the parents of those nodes are. + */ + static bool requiresIndex(const MatchExpression* node); }; } // namespace mongo -- cgit v1.2.1