Skip to content

Commit 753c16d

Browse files
bshteinfeldEvergreen Agent
authored andcommitted
SERVER-82978 Disable parameterization when histogram CE is enabled
1 parent 8c70d83 commit 753c16d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/mongo/db/query/cqf_get_executor.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,10 @@ boost::optional<ExecParams> getSBEExecutorViaCascadesOptimizer(
896896
createInitialScanProps(scanProjName, scanDefName));
897897

898898
// Check if pipeline is eligible for plan caching.
899-
auto _isCacheable = false;
899+
// TODO SERVER-83414: Enable histogram CE with parameterization.
900+
auto _isCacheable = (internalQueryCardinalityEstimatorMode != "histogram"_sd);
900901
if (pipeline) {
901-
_isCacheable = [&]() -> bool {
902+
_isCacheable &= [&]() -> bool {
902903
auto& sources = pipeline->getSources();
903904
if (sources.empty())
904905
return false;
@@ -917,16 +918,19 @@ boost::optional<ExecParams> getSBEExecutorViaCascadesOptimizer(
917918
return true;
918919
}();
919920
_isCacheable = false; // TODO: SERVER-82185: Remove once E2E parameterization enabled
920-
if (_isCacheable)
921+
if (_isCacheable) {
921922
MatchExpression::parameterize(
922923
dynamic_cast<DocumentSourceMatch*>(pipeline->peekFront())->getMatchExpression());
924+
}
923925
abt = translatePipelineToABT(metadata, *pipeline, scanProjName, std::move(abt), prefixId);
924926
} else {
925927
// Clear match expression auto-parameterization by setting max param count to zero before
926928
// CQ to ABT translation
927929
// TODO: SERVER-82185: Update value of _isCacheable to true for M2-eligible queries
928-
if (!_isCacheable)
930+
_isCacheable = false; // TODO: SERVER-82185: Remove once E2E parameterization enabled
931+
if (!_isCacheable) {
929932
MatchExpression::unparameterize(canonicalQuery->getPrimaryMatchExpression());
933+
}
930934
abt = translateCanonicalQueryToABT(
931935
metadata, *canonicalQuery, scanProjName, std::move(abt), prefixId);
932936
}

0 commit comments

Comments
 (0)