diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-01-24 10:11:33 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-02-17 09:57:19 -0500 |
commit | f77527a942347313e2848e050e89480bc3cadb95 (patch) | |
tree | 2f0ec380db30e51d1120a0c0cbb7e4fcfa39f8ed /src/mongo/db/matcher | |
parent | 9c8c662a9213b16ae206f495c875594f5f0454f0 (diff) | |
download | mongo-f77527a942347313e2848e050e89480bc3cadb95.tar.gz |
SERVER-13732 Index access plan for contained OR should consider top-level predicates
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r-- | src/mongo/db/matcher/expression.h | 2 | ||||
-rw-r--r-- | src/mongo/db/matcher/expression_tree.h | 12 |
2 files changed, 14 insertions, 0 deletions
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<MatchExpression> releaseChild(size_t i) { auto child = std::unique_ptr<MatchExpression>(_expressions[i]); _expressions[i] = nullptr; return child; } + /* + * Removes the ith child, and releases ownership of the child. + */ + virtual std::unique_ptr<MatchExpression> removeChild(size_t i) { + auto child = std::unique_ptr<MatchExpression>(_expressions[i]); + _expressions.erase(_expressions.begin() + i); + return child; + } + virtual std::vector<MatchExpression*>* getChildVector() { return &_expressions; } |