mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
ExecInitAgg: update aggstate->numaggs and ->numtrans earlier.
Functions hash_agg_entry_size() and build_hash_tables() make use of those values for memory size estimates. Because this change only affects memory estimates, don't backpatch. Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com
This commit is contained in:
@ -3379,8 +3379,8 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
max_aggno = Max(max_aggno, aggref->aggno);
|
max_aggno = Max(max_aggno, aggref->aggno);
|
||||||
max_transno = Max(max_transno, aggref->aggtransno);
|
max_transno = Max(max_transno, aggref->aggtransno);
|
||||||
}
|
}
|
||||||
numaggs = max_aggno + 1;
|
aggstate->numaggs = numaggs = max_aggno + 1;
|
||||||
numtrans = max_transno + 1;
|
aggstate->numtrans = numtrans = max_transno + 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For each phase, prepare grouping set data and fmgr lookup data for
|
* For each phase, prepare grouping set data and fmgr lookup data for
|
||||||
@ -3943,13 +3943,6 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
ReleaseSysCache(aggTuple);
|
ReleaseSysCache(aggTuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Update aggstate->numaggs to be the number of unique aggregates found.
|
|
||||||
* Also set numstates to the number of unique transition states found.
|
|
||||||
*/
|
|
||||||
aggstate->numaggs = numaggs;
|
|
||||||
aggstate->numtrans = numtrans;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last, check whether any more aggregates got added onto the node while
|
* Last, check whether any more aggregates got added onto the node while
|
||||||
* we processed the expressions for the aggregate arguments (including not
|
* we processed the expressions for the aggregate arguments (including not
|
||||||
|
Reference in New Issue
Block a user