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