diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2020-11-24 10:45:00 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2020-11-24 10:45:00 +0200 |
commit | 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b (patch) | |
tree | 8f630f828fa6bbfb5984f037118211cd68d8a50e /contrib/postgres_fdw/postgres_fdw.c | |
parent | e522024bd8dd28a0f13dcccfd39170698f45c939 (diff) | |
download | postgresql-0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b.tar.gz postgresql-0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b.zip |
Move per-agg and per-trans duplicate finding to the planner.
This has the advantage that the cost estimates for aggregates can count
the number of calls to transition and final functions correctly.
Bump catalog version, because views can contain Aggrefs.
Reviewed-by: Andres Freund
Discussion: https://www.postgresql.org/message-id/b2e3536b-1dbc-8303-c97e-89cb0b4a9a48%40iki.fi
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 9c5aaacc515..b6c72e1d1e6 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -32,6 +32,7 @@ #include "optimizer/pathnode.h" #include "optimizer/paths.h" #include "optimizer/planmain.h" +#include "optimizer/prep.h" #include "optimizer/restrictinfo.h" #include "optimizer/tlist.h" #include "parser/parsetree.h" @@ -2944,16 +2945,7 @@ estimate_path_cost_size(PlannerInfo *root, MemSet(&aggcosts, 0, sizeof(AggClauseCosts)); if (root->parse->hasAggs) { - get_agg_clause_costs(root, (Node *) fpinfo->grouped_tlist, - AGGSPLIT_SIMPLE, &aggcosts); - - /* - * The cost of aggregates in the HAVING qual will be the same - * for each child as it is for the parent, so there's no need - * to use a translated version of havingQual. - */ - get_agg_clause_costs(root, (Node *) root->parse->havingQual, - AGGSPLIT_SIMPLE, &aggcosts); + get_agg_clause_costs(root, AGGSPLIT_SIMPLE, &aggcosts); } /* Get number of grouping columns and possible number of groups */ |