Re: HashAgg's batching counter starts at 0, but Hash's starts at 1.
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: David Rowley <dgrowleyml@gmail.com>, James Coleman <jtc331@gmail.com>, Jeff Davis <pgsql@j-davis.com>, pgsql-hackers@lists.postgresql.org
Date: 2020-07-30T04:05:02Z
Lists: pgsql-hackers
On Wed, Jul 29, 2020 at 08:35:08PM -0700, Peter Geoghegan wrote:
> AFAICT sort (and IncrSort) don't fail to show a field value if it is
> zero. Rather, they consistently show "space used" (in non-text
> format), which can be either memory or disk space. Technically they
> don't violate the letter of the law that you cite. (Though admittedly
> this is a legalistic loophole -- the "space" value presumably has to
> be interpreted according to different rules for programs that consume
> non-text EXPLAIN output.)
Sort shows this:
Sort Method: "external merge" +
Sort Space Used: 19520 +
Sort Space Type: "Disk" +
Incremental sort shows this:
Sort Methods Used: +
- "external merge" +
Sort Space Disk: +
Average Sort Space Used: 128+
Peak Sort Space Used: 128 +
So my 2ndary suggestion is to conditionalize based on the method rather than
value of space used.
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -2830 +2830 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
- if (groupInfo->maxMemorySpaceUsed > 0)
+ if (groupInfo->sortMethods & SORT_TYPE_QUICKSORT)
@@ -2847 +2847 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
- if (groupInfo->maxDiskSpaceUsed > 0)
+ if (groupInfo->sortMethods & SORT_TYPE_EXTERNAL_SORT)
--
Justin
Commits
-
Make EXPLAIN ANALYZE of HashAgg more similar to Hash Join
- a57c837e5cdf 13.0 landed
- 0e3e1c4e1cea 14.0 landed
-
Further adjustments to Hashagg EXPLAIN ANALYZE output
- 40efbf8706cd 14.0 cited
-
Fix handling of "Subplans Removed" field in EXPLAIN output.
- 7d91b604d9b5 13.0 cited
-
Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields.
- 3ec20c7091e9 13.0 cited
-
Fix some infelicities in EXPLAIN output for parallel query plans.
- 8ebb69f85445 9.6.0 cited