Re: [PG13] Planning (time + buffers) data structure in explain plan (format text)
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>,
Pierre Giraud <pierre.giraud@dalibo.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>,
Fujii Masao <fujii@postgresql.org>
Date: 2020-08-19T11:24:37Z
Lists: pgsql-hackers
Attachments
- explain_buffers_without_analyze.patch (application/octet-stream) patch
On Wed, 19 Aug 2020 at 22:39, David Rowley <dgrowleyml@gmail.com> wrote:
> so, maybe we can just error if analyze == off AND buffers == on AND
> summary == off. We likely should pay attention to analyze there as it
> seems perfectly fine to EXPLAIN (ANALYZE, BUFFERS, SUMMARY off). We
> quite often do SUMMARY off for the regression tests... I think that
> might have been why it was added in the first place.
I had something like the attached in mind.
postgres=# explain (buffers) select * from t1 where a > 4000000;
QUERY PLAN
--------------------------------------------------------------------------
Index Only Scan using t1_pkey on t1 (cost=0.42..10.18 rows=100 width=4)
Index Cond: (a > 4000000)
Planning Time: 13.341 ms
Buffers: shared hit=2735
(4 rows)
It does look a bit weirder if the planner didn't do any buffer work:
postgres=# explain (buffers) select * from pg_class;
QUERY PLAN
--------------------------------------------------------------
Seq Scan on pg_class (cost=0.00..443.08 rows=408 width=768)
Planning Time: 0.136 ms
(2 rows)
but that's not a combination that people were able to use before, so I
think it's ok to show the planning time there.
David
Commits
-
Fix explain regression test failure.
- bc2ebf3acfd2 13.0 landed
- eabba4a3eb71 14.0 landed
-
Rework EXPLAIN for planner's buffer usage.
- 674899ae02c3 13.0 landed
- 9d701e624f4b 14.0 landed