summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/plan_enumerator.h
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2022-12-02 17:48:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-17 01:00:57 +0000
commitf7dc2ed1335f3d24e69ac5a147f8eff2f131816a (patch)
treeb49139ad6acf82b2e17a75ec66848119a8dde1bd /src/mongo/db/query/plan_enumerator.h
parentbee900479c804e95b1911b2d52649979339b337c (diff)
downloadmongo-f7dc2ed1335f3d24e69ac5a147f8eff2f131816a.tar.gz
SERVER-70597 Don't generate OrPushdown tags when optimization is disabled
Diffstat (limited to 'src/mongo/db/query/plan_enumerator.h')
-rw-r--r--src/mongo/db/query/plan_enumerator.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/query/plan_enumerator.h b/src/mongo/db/query/plan_enumerator.h
index 60344f0c9ee..36a01f52d50 100644
--- a/src/mongo/db/query/plan_enumerator.h
+++ b/src/mongo/db/query/plan_enumerator.h
@@ -44,7 +44,8 @@ namespace mongo {
struct PlanEnumeratorParams {
PlanEnumeratorParams()
: maxSolutionsPerOr(internalQueryEnumerationMaxOrSolutions.load()),
- maxIntersectPerAnd(internalQueryEnumerationMaxIntersectPerAnd.load()) {}
+ maxIntersectPerAnd(internalQueryEnumerationMaxIntersectPerAnd.load()),
+ disableOrPushdown(disableMatchExpressionOptimization.shouldFail()) {}
// Do we provide solutions that use more indices than the minimum required to provide
// an indexed solution?
@@ -69,6 +70,11 @@ struct PlanEnumeratorParams {
// all-pairs approach, we could wind up creating a lot of enumeration possibilities for
// certain inputs.
size_t maxIntersectPerAnd;
+
+ // Whether to disable OR-pushdown optimization. OR-pushdown assumes that the expression has been
+ // simplified: for example, that single-child $or nodes are unwrapped. To avoid this, when
+ // the 'disableMatchExpressionOptimization' failpoint is set, we also disable OR-pushdown.
+ bool disableOrPushdown;
};
/**
@@ -594,6 +600,9 @@ private:
// How many things do we want from each AND?
size_t _intersectLimit;
+
+ // Whether we should disable OR-pushdown optimization.
+ const bool _disableOrPushdown;
};
} // namespace mongo