Missing HashAgg EXPLAIN ANALYZE details for parallel plans
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>,
Jeff Davis <pgsql@j-davis.com>
Date: 2020-06-18T03:37:21Z
Lists: pgsql-hackers
Attachments
- hashagg_explain_fix.patch (application/octet-stream) patch
Hi,
Now that HashAgg can spill to disk, we see a few more details in
EXPLAIN ANALYZE than we did previously, e.g. Peak Memory Usage, Disk
Usage. However, the new code neglected to make EXPLAIN ANALYZE show
these new details for parallel workers.
Additionally, the new properties all were using
ExplainPropertyInteger() which meant that we got output like:
QUERY PLAN
---------------------------------------------------------------------
HashAggregate (actual time=31.724..87.638 rows=1000 loops=1)
Group Key: a
Peak Memory Usage: 97 kB
Disk Usage: 3928 kB
HashAgg Batches: 798
-> Seq Scan on ab (actual time=0.006..9.243 rows=100000 loops=1)
Where all the properties were on a line by themselves. This does not
really follow what other nodes are doing, e.g sort:
QUERY PLAN
---------------------------------------------------------------------------
GroupAggregate (actual time=47.530..70.935 rows=1000 loops=1)
Group Key: a
-> Sort (actual time=47.500..59.344 rows=100000 loops=1)
Sort Key: a
Sort Method: external merge Disk: 2432kB
-> Seq Scan on ab (actual time=0.004..8.476 rows=100000 loops=1)
Where we stick all the properties on a single line.
The attached patch fixes both the missing parallel worker information
and puts the properties on a single line for format=text.
I'd like to push this in the next few days.
David
Commits
-
Fix whitespace in HashAgg EXPLAIN ANALYZE
- 285da44a69dd 13.0 landed
- 2b7dbc0db6ec 14.0 landed
-
Fix EXPLAIN ANALYZE for parallel HashAgg plans
- bdee4af8e076 13.0 landed
- 9bdb300dedf0 14.0 landed
-
Rework EXPLAIN format for incremental sort
- 6a918c3ac8a6 13.0 cited