Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit40efbf8

Browse files
committed
Further adjustments to Hashagg EXPLAIN ANALYZE output
The "Disk Usage" and "HashAgg Batches" properties in the EXPLAIN ANALYZEoutput for HashAgg were previously only shown if the number of batcheswas greater than 0. Here we change this so that these properties arealways shown for EXPLAIN ANALYZE formats other than "text". The idea hereis that since the HashAgg could have spilled to disk if there had beenmore data or groups to aggregate, then it's relevant that we're clear inthe EXPLAIN ANALYZE output when no spilling occurred in this particularexecution of the given plan.For the "text" EXPLAIN format, we still hide these properties when nospilling occurs. This EXPLAIN format is designed to be easy for humansto read. To maintain the readability we have a higher threshold for whichproperties we display for this format.Discussion:https://postgr.es/m/CAApHDvo_dmNozQQTmN-2jGp1vT%3Ddxx7Q0vd%2BMvD1cGpv2HU%3DSg%40mail.gmail.comBackpatch-through: 13, where the hashagg spilling code was added.
1 parente576f71 commit40efbf8

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

‎src/backend/commands/explain.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,13 +3070,10 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
30703070

30713071
/* EXPLAIN ANALYZE */
30723072
ExplainPropertyInteger("Peak Memory Usage","kB",memPeakKb,es);
3073-
if (aggstate->hash_batches_used>0)
3074-
{
3075-
ExplainPropertyInteger("Disk Usage","kB",
3076-
aggstate->hash_disk_used,es);
3077-
ExplainPropertyInteger("HashAgg Batches",NULL,
3078-
aggstate->hash_batches_used,es);
3079-
}
3073+
ExplainPropertyInteger("Disk Usage","kB",
3074+
aggstate->hash_disk_used,es);
3075+
ExplainPropertyInteger("HashAgg Batches",NULL,
3076+
aggstate->hash_batches_used,es);
30803077
}
30813078
else
30823079
{
@@ -3145,13 +3142,9 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
31453142
{
31463143
ExplainPropertyInteger("Peak Memory Usage","kB",memPeakKb,
31473144
es);
3148-
if (hash_batches_used>0)
3149-
{
3150-
ExplainPropertyInteger("Disk Usage","kB",hash_disk_used,
3151-
es);
3152-
ExplainPropertyInteger("HashAgg Batches",NULL,
3153-
hash_batches_used,es);
3154-
}
3145+
ExplainPropertyInteger("Disk Usage","kB",hash_disk_used,es);
3146+
ExplainPropertyInteger("HashAgg Batches",NULL,
3147+
hash_batches_used,es);
31553148
}
31563149

31573150
if (es->workers_state)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp