summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_bounds_builder.h
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-10-05 13:04:39 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-10-07 15:07:16 -0400
commita5c4104bb28f2870602a8c7a5e4a4b506dbc99a1 (patch)
tree3617caf0663936d4b109f3ff6ba590f307078f41 /src/mongo/db/query/index_bounds_builder.h
parentb7660950c4888052f2c68a02f6667c114a72dfbd (diff)
downloadmongo-a5c4104bb28f2870602a8c7a5e4a4b506dbc99a1.tar.gz
SERVER-10471 merge index bounds, enumerate based on indices, bug fixes
Diffstat (limited to 'src/mongo/db/query/index_bounds_builder.h')
-rw-r--r--src/mongo/db/query/index_bounds_builder.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_bounds_builder.h b/src/mongo/db/query/index_bounds_builder.h
index 7c96cab676a..5a0921a213f 100644
--- a/src/mongo/db/query/index_bounds_builder.h
+++ b/src/mongo/db/query/index_bounds_builder.h
@@ -58,6 +58,20 @@ namespace mongo {
static void translate(const MatchExpression* expr, const BSONElement& elt,
OrderedIntervalList* oilOut, bool* exactOut);
+ /**
+ * Creates bounds for 'expr' (indexed according to 'elt'). Intersects those bounds
+ * with the bounds in oilOut, which is an in/out parameter.
+ */
+ static void translateAndIntersect(const MatchExpression* expr, const BSONElement& elt,
+ OrderedIntervalList* oilOut, bool* exactOut);
+
+ /**
+ * Creates bounds for 'expr' (indexed according to 'elt'). Unions those bounds
+ * with the bounds in oilOut, which is an in/out parameter.
+ */
+ static void translateAndUnion(const MatchExpression* expr, const BSONElement& elt,
+ OrderedIntervalList* oilOut, bool* exactOut);
+
private:
friend class ExpressionMapping;
@@ -91,7 +105,27 @@ namespace mongo {
*/
static void reverseInterval(Interval* ival);
+ /**
+ * Copied almost verbatim from db/queryutil.cpp.
+ *
+ * returns a string that when used as a matcher, would match a super set of regex()
+ *
+ * returns "" for complex regular expressions
+ *
+ * used to optimize queries in some simple regex cases that start with '^'
+ */
+ static string simpleRegex(const char* regex, const char* flags, bool* exact);
+
static Interval allValues();
+
+ static void translateRegex(const RegexMatchExpression* rme, OrderedIntervalList* oil,
+ bool* exact);
+
+ static void translateEquality(const BSONElement& data, bool isHashed,
+ OrderedIntervalList* oil, bool* exact);
+
+ static void unionize(OrderedIntervalList* oilOut);
+ static void intersectize(const OrderedIntervalList& arg, OrderedIntervalList* oilOut);
};
} // namespace mongo