diff --git a/pkg/planner/core/exhaust_physical_plans.go b/pkg/planner/core/exhaust_physical_plans.go index fb7222bdc6a65..652aa4ecbc2ca 100644 --- a/pkg/planner/core/exhaust_physical_plans.go +++ b/pkg/planner/core/exhaust_physical_plans.go @@ -3578,6 +3578,7 @@ func (la *LogicalAggregation) ExhaustPhysicalPlans(prop *property.PhysicalProper } preferHash, preferStream := la.ResetHintIfConflicted() + hashAggs := la.getHashAggs(prop) if hashAggs != nil && preferHash { return hashAggs, true, nil diff --git a/pkg/planner/core/find_best_task.go b/pkg/planner/core/find_best_task.go index dd4e61ee37a9f..5d4df34ac6c01 100644 --- a/pkg/planner/core/find_best_task.go +++ b/pkg/planner/core/find_best_task.go @@ -186,6 +186,7 @@ func enumeratePhysicalPlans4Task( if _, ok := p.Self().(*LogicalSequence); ok { iteration = iterateChildPlan4LogicalSequence } + for _, pp := range physicalPlans { timeStampNow := p.GetLogicalTS4TaskMap() savedPlanID := p.SCtx().GetSessionVars().PlanID.Load()