summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_solution.h
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-08-08 23:15:00 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-08-12 11:52:13 -0400
commit69f264e93dee509597f787773e1f05e1ec313d2b (patch)
tree5880c7cda25e10118467317ec158da3d7913da68 /src/mongo/db/query/query_solution.h
parent525f2f11ac545221f1b0af0746d0891c40ed9aa7 (diff)
downloadmongo-69f264e93dee509597f787773e1f05e1ec313d2b.tar.gz
SERVER-10026 SERVER-10471 unittestable query planner
Diffstat (limited to 'src/mongo/db/query/query_solution.h')
-rw-r--r--src/mongo/db/query/query_solution.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h
index bc57a3c969f..82ee2d5295e 100644
--- a/src/mongo/db/query/query_solution.h
+++ b/src/mongo/db/query/query_solution.h
@@ -17,6 +17,7 @@
#pragma once
#include "mongo/db/matcher/expression.h"
+#include "mongo/db/query/index_bounds.h"
#include "mongo/db/query/stage_types.h"
namespace mongo {
@@ -89,7 +90,37 @@ namespace mongo {
// Not owned.
// This is a sub-tree of the filter in the QuerySolution that owns us.
+ // TODO: This may change in the future.
MatchExpression* filter;
};
+ struct IndexScanNode : public QuerySolutionNode {
+ IndexScanNode() : filter(NULL), limit(0), direction(1) { }
+
+ virtual StageType getType() const { return STAGE_IXSCAN; }
+
+ virtual void appendToString(stringstream* ss) const {
+ *ss << "IXSCAN kp=" << indexKeyPattern;
+ if (NULL != filter) {
+ *ss << " filter= " << filter->toString();
+ }
+ *ss << " dir = " << direction;
+ *ss << " bounds = " << bounds.toString();
+ }
+
+ BSONObj indexKeyPattern;
+
+ // Not owned.
+ // This is a sub-tree of the filter in the QuerySolution that owns us.
+ // TODO: This may change in the future.
+ MatchExpression* filter;
+
+ // Only set for 2d.
+ int limit;
+
+ int direction;
+
+ IndexBounds bounds;
+ };
+
} // namespace mongo