mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -3839,12 +3839,14 @@ estimate_hash_bucket_stats(PlannerInfo *root, Node *hashkey, double nbuckets,
|
||||
* won't store them. Is this a problem?
|
||||
*/
|
||||
double
|
||||
estimate_hashagg_tablesize(Path *path, const AggClauseCosts *agg_costs,
|
||||
double dNumGroups)
|
||||
estimate_hashagg_tablesize(PlannerInfo *root, Path *path,
|
||||
const AggClauseCosts *agg_costs, double dNumGroups)
|
||||
{
|
||||
Size hashentrysize = hash_agg_entry_size(agg_costs->numAggs,
|
||||
path->pathtarget->width,
|
||||
agg_costs->transitionSpace);
|
||||
Size hashentrysize;
|
||||
|
||||
hashentrysize = hash_agg_entry_size(list_length(root->aggtransinfos),
|
||||
path->pathtarget->width,
|
||||
agg_costs->transitionSpace);
|
||||
|
||||
/*
|
||||
* Note that this disregards the effect of fill-factor and growth policy
|
||||
|
Reference in New Issue
Block a user