From 1a5ed622b4b73c89c3fd75d2d40ebac4cd9a894d Mon Sep 17 00:00:00 2001 From: Han Fei Date: Tue, 8 Jun 2021 13:38:13 +0800 Subject: [PATCH] add comments --- planner/core/physical_plans.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/planner/core/physical_plans.go b/planner/core/physical_plans.go index 75e22ff8d6e01..d3169c865e07b 100644 --- a/planner/core/physical_plans.go +++ b/planner/core/physical_plans.go @@ -1059,6 +1059,10 @@ func (p *basePhysicalAgg) getAggFuncCostFactor(isMPP bool) (factor float64) { } if factor == 0 { if isMPP { + // The default factor 1.0 will lead to 1-phase agg in pseudo stats settings. + // But in mpp cases, 2-phase is more usual. So we change this factor. + // TODO: This is still a little tricky and might cause regression. We should + // calibrate these factors and polish our cost model in the future. factor = aggFuncFactor[ast.AggFuncFirstRow] } else { factor = 1.0