BUFFERS enabled by default in EXPLAIN (ANALYZE) - Mailing list pgsql-hackers

From Nikolay Samokhvalov
Subject BUFFERS enabled by default in EXPLAIN (ANALYZE)
Date
Msg-id CANNMO++=LrJ4upoeydZhbmpd_ZgZjrTLueKSrivn6xmb=yFwQw@mail.gmail.com
Whole thread Raw
Responses Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)
Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)
Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)
List pgsql-hackers
Re-reading the thread [1] (cannot answer there – don't have those emails in my box anymore), I see that there was strong support for enabling BUFFERS in EXPLAIN ANALYZE by default. And there were patches. Commitfest entry [2] was marked Rejected because there were questions to the implementation based on GUCs.

Attached is a simple patch enabling BUFFERS by default, without involving GUCs.

Why it is important?

In many cases, people forget about the BUFFERS option in EXPLAIN ANALYZE and share execution plans without it – sending it via regular communication channels for work or publishing to visualization systems. Meanwhile, the option has a lower overhead compared to TIMING (enabled by default for EXPLAIN ANALYZE) and it is extremely useful for query
optimization. This patch doesn't enable BUFFERS for EXPLAIN executed
without ANALYZE.

Open questions:

1. Should BUFFERS be enabled for regular (w/o ANALYZE) EXPLAIN? Now it may make sense because of the buffer numbers the planner uses. This patch doesn't do that, but it definitely may make sense because it can help people understand why planning time is so big, in some cases.

2. How to adjust documentation? Should EXPLAIN ANALYZE examples be adjusted to use BUFFERS OFF (easier change) or show some example buffer numbers – like it is done for timing and cost numbers? I tend to think that the latter makes more sense. 

3. How to adjust regression tests? Of course, now many tests fail. Same question as for documentation. Excluding buffer, numbers would be an easier fix, of course – but at least some tests should
check the behavior of BUFFERS (such as both default options – with and without ANALYZE).
On any given platform, the buffer numbers are pretty stable, so we could rely on it, but I'm not sure about all possible options being tested and would appreciate advice here (of course, if the patch makes it thru the discussion in general).

Attachment

pgsql-hackers by date:

Previous
From: Ilya Anfimov
Date:
Subject: Re: Should AT TIME ZONE be volatile?
Next
From: Alvaro Herrera
Date:
Subject: Re: ALTER TABLE DETACH PARTITION violates serializability