summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/canonical_query.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/canonical_query.h')
-rw-r--r--src/mongo/db/query/canonical_query.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/db/query/canonical_query.h b/src/mongo/db/query/canonical_query.h
index e939c248a9d..fe0599a1b6a 100644
--- a/src/mongo/db/query/canonical_query.h
+++ b/src/mongo/db/query/canonical_query.h
@@ -233,6 +233,14 @@ public:
return _sbeCompatible;
}
+ void setUseCqfIfEligible(bool useCqfIfEligible) {
+ _useCqfIfEligible = useCqfIfEligible;
+ }
+
+ bool useCqfIfEligible() const {
+ return _useCqfIfEligible;
+ }
+
bool isParameterized() const {
return !_inputParamIdToExpressionMap.empty();
}
@@ -318,6 +326,16 @@ private:
// True if this query can be executed by the SBE.
bool _sbeCompatible = false;
+ // If true, indicates that we should use CQF if this query is eligible (see the
+ // isEligibleForBonsai() function for eligiblitly requirements).
+ // If false, indicates that we shouldn't use CQF even if this query is eligible. This is used to
+ // prevent hybrid classic and CQF plans in the following cases:
+ // 1. A pipeline that is not eligible for CQF but has an eligible prefix pushed down to find.
+ // 2. A subpipeline pushed down to find as part of a $lookup or $graphLookup.
+ // The default value of false ensures that only codepaths (find command) which opt-in are able
+ // to use CQF.
+ bool _useCqfIfEligible = false;
+
// True if this query must produce a RecordId output in addition to the BSON objects that
// constitute the result set of the query. Any generated query solution must not discard record
// ids, even if the optimizer detects that they are not going to be consumed downstream.