You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2024/12/23 11:11:12 UTC

(cloudberry) 17/23: fix fixme in planner about calculating dNumGroups for grouping sets

This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 866ec2b91ae4301595ba42e0e5bb860d6ea672e1
Author: zxuejing <zx...@vmware.com>
AuthorDate: Mon Jun 20 20:04:34 2022 -0700

    fix fixme in planner about calculating dNumGroups for grouping sets
    
    1.remove useless codes, the last param is removed in create_groupingsets_path,
    so there is no need to calculate dNumGroups before create_groupingsets_path.
    
    2.the last param of consider_groupingsets_paths should be dNumGroupsTotal.
    in consider_groupingsets_paths it will calculate dNumGroups in one segment.
---
 src/backend/optimizer/plan/planner.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index e8ced6faa3..4377f04f34 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -4593,23 +4593,6 @@ consider_groupingsets_paths(PlannerInfo *root,
 											   parse->groupClause,
 											   srd->new_rollups);
 
-		// GPDB_12_MERGE_FIXME: fix computation of dNumGroups
-#if 0
-		/*
-		 * dNumGroupsTotal is the total number of groups across all segments. If the
-		 * Aggregate is distributed, then the number of groups in one segment
-		 * is only a fraction of the total.
-		 */
-		if (CdbPathLocus_IsPartitioned(path->locus))
-		{
-			dNumGroups = clamp_row_est(dNumGroupsTotal /
-									   CdbPathLocus_NumSegments(path->locus));
-			if (path->locus.parallel_workers > 1)
-				dNumGroups /= path->locus.parallel_workers;
-		}
-		else
-			dNumGroups = dNumGroupsTotal;
-#endif
 
 		add_path(grouped_rel, (Path *)
 				 create_groupingsets_path(root,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org