@@ -896,9 +896,10 @@ boost::optional<ExecParams> getSBEExecutorViaCascadesOptimizer(
896
896
createInitialScanProps (scanProjName, scanDefName));
897
897
898
898
// 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);
900
901
if (pipeline) {
901
- _isCacheable = [&]() -> bool {
902
+ _isCacheable & = [&]() -> bool {
902
903
auto & sources = pipeline->getSources ();
903
904
if (sources.empty ())
904
905
return false ;
@@ -917,16 +918,19 @@ boost::optional<ExecParams> getSBEExecutorViaCascadesOptimizer(
917
918
return true ;
918
919
}();
919
920
_isCacheable = false ; // TODO: SERVER-82185: Remove once E2E parameterization enabled
920
- if (_isCacheable)
921
+ if (_isCacheable) {
921
922
MatchExpression::parameterize (
922
923
dynamic_cast <DocumentSourceMatch*>(pipeline->peekFront ())->getMatchExpression ());
924
+ }
923
925
abt = translatePipelineToABT (metadata, *pipeline, scanProjName, std::move (abt), prefixId);
924
926
} else {
925
927
// Clear match expression auto-parameterization by setting max param count to zero before
926
928
// CQ to ABT translation
927
929
// 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) {
929
932
MatchExpression::unparameterize (canonicalQuery->getPrimaryMatchExpression ());
933
+ }
930
934
abt = translateCanonicalQueryToABT (
931
935
metadata, *canonicalQuery, scanProjName, std::move (abt), prefixId);
932
936
}
0 commit comments