From: Tomas Vondra Date: Sat, 14 Jan 2017 19:51:55 +0000 (+0100) Subject: comment about generating grouping paths with extra combine phase X-Git-Tag: XL_10_R1BETA1~463 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=4ab1534b007ac78d3a9d16728a00a7eb3081a1a0;p=postgres-xl.git comment about generating grouping paths with extra combine phase --- diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 06b172c4db..70c7d51e22 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -4307,6 +4307,25 @@ create_grouping_paths(PlannerInfo *root, } } } + + /* + * TODO So far we've only constructed simple paths combining partial + * and distributed aggregate paths, i.e. + * + * Finalize -> RemoteSubplan -> Gather -> Partial + * + * It may however be more efficient to reduce the amount of data + * transferred over the network by generating paths like this: + * + * Finalize -> RemoteSubplan -> Combine -> Gather -> Partial + * + * where Combine deserialized the aggstates, combines them and then + * serializes them again. This AggSplit case is not defined yet, but + * should not be hard to add. + * + * We only want to do this for partial paths with RemoteSubplan on + * top of them, i.e. when the whole aggregate was not pushed down. + */ } if (can_hash && !(agg_costs->hasNonPartial || agg_costs->hasNonSerial)) @@ -4370,6 +4389,8 @@ create_grouping_paths(PlannerInfo *root, dNumGroups)); } } + + /* TODO Generate the additional paths with extra combine phase here. */ } /* Give a helpful error if we failed to find any implementation */