aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAgg.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2020-07-29 11:43:11 +1200
committerDavid Rowley <drowley@postgresql.org>2020-07-29 11:43:11 +1200
commita57c837e5cdf601d6ec05e5e10a40d01f1d2b84e (patch)
tree98fd0a1430ff78f8e3df368f19f121334a74c943 /src/backend/executor/nodeAgg.c
parentdc6f2fb4353508af27dde44bdf5cb14749ae73a1 (diff)
downloadpostgresql-a57c837e5cdf601d6ec05e5e10a40d01f1d2b84e.tar.gz
postgresql-a57c837e5cdf601d6ec05e5e10a40d01f1d2b84e.zip
Make EXPLAIN ANALYZE of HashAgg more similar to Hash Join
There were various unnecessary differences between Hash Agg's EXPLAIN ANALYZE output and Hash Join's. Here we modify the Hash Agg output so that it's better aligned to Hash Join's. The following changes have been made: 1. Start batches counter at 1 instead of 0. 2. Always display the "Batches" property, even when we didn't spill to disk. 3. Use the text "Batches" instead of "HashAgg Batches" for text format. 4. Use the text "Memory Usage" instead of "Peak Memory Usage" for text format. 5. Include "Batches" before "Memory Usage" in both text and non-text formats. In passing also modify the "Planned Partitions" property so that we show it regardless of if the value is 0 or not for non-text EXPLAIN formats. This was pointed out by Justin Pryzby and probably should have been part of 40efbf870. Reviewed-by: Justin Pryzby, Jeff Davis Discussion: https://postgr.es/m/CAApHDvrshRnA6C0VFnu7Fb9TVvgGo80PUMm5+2DiaS1gEkPvtw@mail.gmail.com Backpatch-through: 13, where HashAgg batching was introduced
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r--src/backend/executor/nodeAgg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index ea928d5cb7c..5ca1751f956 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -3641,6 +3641,9 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
find_hash_columns(aggstate);
build_hash_tables(aggstate);
aggstate->table_filled = false;
+
+ /* Initialize this to 1, meaning nothing spilled, yet */
+ aggstate->hash_batches_used = 1;
}
/*