mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Refactor hash_agg_entry_size().
Consolidate the calculations for hash table size estimation. This will help with upcoming Hash Aggregation work that will add additional call sites.
This commit is contained in:
@ -3526,16 +3526,8 @@ double
|
||||
estimate_hashagg_tablesize(Path *path, const AggClauseCosts *agg_costs,
|
||||
double dNumGroups)
|
||||
{
|
||||
Size hashentrysize;
|
||||
|
||||
/* Estimate per-hash-entry space at tuple width... */
|
||||
hashentrysize = MAXALIGN(path->pathtarget->width) +
|
||||
MAXALIGN(SizeofMinimalTupleHeader);
|
||||
|
||||
/* plus space for pass-by-ref transition values... */
|
||||
hashentrysize += agg_costs->transitionSpace;
|
||||
/* plus the per-hash-entry overhead */
|
||||
hashentrysize += hash_agg_entry_size(agg_costs->numAggs);
|
||||
Size hashentrysize = hash_agg_entry_size(
|
||||
agg_costs->numAggs, 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