diff --git a/planner/core/rule_aggregation_push_down.go b/planner/core/rule_aggregation_push_down.go index 77e4ceee63808..e3ecc5a79cf1e 100644 --- a/planner/core/rule_aggregation_push_down.go +++ b/planner/core/rule_aggregation_push_down.go @@ -548,8 +548,12 @@ func (a *aggregationPushDownSolver) aggPushDown(p LogicalPlan, opt *logicalOptim for j := range funcsArgs { if oldAggFuncsArgs[i][j].GetType().EvalType() != newAggFuncsArgs[i][j].GetType().EvalType() { noSideEffects = false + break } } + if !noSideEffects { + break + } } if noSideEffects { agg.GroupByItems = newGbyItems