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 /src/backend/optimizer/path | |
| parent | e522024bd8dd28a0f13dcccfd39170698f45c939 (diff) | |
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 'src/backend/optimizer/path')
| -rw-r--r-- | src/backend/optimizer/path/costsize.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index f1dfdc1a4a1..22d6935824a 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -2439,7 +2439,8 @@ cost_agg(Path *path, PlannerInfo *root,  		 * than or equal to one, all groups are expected to fit in memory;  		 * otherwise we expect to spill.  		 */ -		hashentrysize = hash_agg_entry_size(aggcosts->numAggs, input_width, +		hashentrysize = hash_agg_entry_size(list_length(root->aggtransinfos), +											input_width,  											aggcosts->transitionSpace);  		hash_agg_set_limits(hashentrysize, numGroups, 0, &mem_limit,  							&ngroups_limit, &num_partitions);  | 
