Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 888fa2b

Browse files
committed
Skip allocating hash table in EXPLAIN-only mode.
This is a backpatch of commit 2cccb62, 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
1 parent 5b83604 commit 888fa2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/executor/nodeAgg.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,11 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
24882488
aggstate->hash_pergroup = pergroups;
24892489

24902490
find_hash_columns(aggstate);
2491-
build_hash_table(aggstate);
2491+
2492+
/* Skip massive memory allocation if we are just doing EXPLAIN */
2493+
if (!(eflags & EXEC_FLAG_EXPLAIN_ONLY))
2494+
build_hash_table(aggstate);
2495+
24922496
aggstate->table_filled = false;
24932497
}
24942498

0 commit comments

Comments
 (0)