From f77527a942347313e2848e050e89480bc3cadb95 Mon Sep 17 00:00:00 2001 From: Tess Avitabile Date: Tue, 24 Jan 2017 10:11:33 -0500 Subject: SERVER-13732 Index access plan for contained OR should consider top-level predicates --- src/mongo/db/matcher/expression.h | 2 ++ src/mongo/db/matcher/expression_tree.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'src/mongo/db/matcher') diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h index 95c0c8a3a9c..2f2b5a494a8 100644 --- a/src/mongo/db/matcher/expression.h +++ b/src/mongo/db/matcher/expression.h @@ -213,9 +213,11 @@ public: class TagData { public: + enum class Type { IndexTag, RelevantTag, OrPushdownTag }; virtual ~TagData() {} virtual void debugString(StringBuilder* builder) const = 0; virtual TagData* clone() const = 0; + virtual Type getType() const = 0; }; /** diff --git a/src/mongo/db/matcher/expression_tree.h b/src/mongo/db/matcher/expression_tree.h index 1e751f0f98c..d444f5b3ddc 100644 --- a/src/mongo/db/matcher/expression_tree.h +++ b/src/mongo/db/matcher/expression_tree.h @@ -65,12 +65,24 @@ public: return _expressions[i]; } + /* + * Replaces the ith child with nullptr, and releases ownership of the child. + */ virtual std::unique_ptr releaseChild(size_t i) { auto child = std::unique_ptr(_expressions[i]); _expressions[i] = nullptr; return child; } + /* + * Removes the ith child, and releases ownership of the child. + */ + virtual std::unique_ptr removeChild(size_t i) { + auto child = std::unique_ptr(_expressions[i]); + _expressions.erase(_expressions.begin() + i); + return child; + } + virtual std::vector* getChildVector() { return &_expressions; } -- cgit v1.2.1