mirror of
https://github.com/postgres/postgres.git
synced 2025-06-07 11:02:12 +03:00
Skip allocating hash table in EXPLAIN-only mode.
This is a backpatch of commit 2cccb627f1, backpatched due to popular demand. Backpatch to all supported versions. Author: Alexey Bashtanov Discussion: https://www.postgresql.org/message-id/36823f65-050d-ae24-aa4d-a37726998240%40imap.cc
This commit is contained in:
parent
e7abc11116
commit
02a2dbe91d
@ -2664,7 +2664,10 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
|||||||
|
|
||||||
if (node->aggstrategy == AGG_HASHED)
|
if (node->aggstrategy == AGG_HASHED)
|
||||||
{
|
{
|
||||||
build_hash_table(aggstate);
|
/* Skip massive memory allocation if we are just doing EXPLAIN */
|
||||||
|
if (!(eflags & EXEC_FLAG_EXPLAIN_ONLY))
|
||||||
|
build_hash_table(aggstate);
|
||||||
|
|
||||||
aggstate->table_filled = false;
|
aggstate->table_filled = false;
|
||||||
/* Compute the columns we actually need to hash on */
|
/* Compute the columns we actually need to hash on */
|
||||||
aggstate->hash_needed = find_hash_columns(aggstate);
|
aggstate->hash_needed = find_hash_columns(aggstate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user