Skip to content

Commit 2b7dbc0

Browse files
committed
Fix whitespace in HashAgg EXPLAIN ANALYZE
The Sort node does not put a space between the number of kilobytes and the "kB" of memory or disk space used, but HashAgg does. Here we align HashAgg to do the same as Sort. Sort has been displaying this information for longer than HashAgg, so it makes sense to align HashAgg to Sort rather than the other way around. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20200708163021.GW4107@telsasoft.com Backpatch-through: 13, where the hashagg started showing these details
1 parent a9a4a7a commit 2b7dbc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/commands/explain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,11 +3099,11 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
30993099
else
31003100
appendStringInfoString(es->str, " ");
31013101

3102-
appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT " kB",
3102+
appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT "kB",
31033103
memPeakKb);
31043104

31053105
if (aggstate->hash_batches_used > 0)
3106-
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT " kB HashAgg Batches: %d",
3106+
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT "kB HashAgg Batches: %d",
31073107
aggstate->hash_disk_used,
31083108
aggstate->hash_batches_used);
31093109
appendStringInfoChar(es->str, '\n');
@@ -3130,11 +3130,11 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
31303130
{
31313131
ExplainIndentText(es);
31323132

3133-
appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT " kB",
3133+
appendStringInfo(es->str, "Peak Memory Usage: " INT64_FORMAT "kB",
31343134
memPeakKb);
31353135

31363136
if (hash_batches_used > 0)
3137-
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT " kB HashAgg Batches: %d",
3137+
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT "kB HashAgg Batches: %d",
31383138
hash_disk_used, hash_batches_used);
31393139
appendStringInfoChar(es->str, '\n');
31403140
}

0 commit comments

Comments
 (0)