BUFFERS enabled by default in EXPLAIN (ANALYZE)

Поиск
Список
Период
Сортировка
От Nikolay Samokhvalov
Тема BUFFERS enabled by default in EXPLAIN (ANALYZE)
Дата
Msg-id CANNMO++=LrJ4upoeydZhbmpd_ZgZjrTLueKSrivn6xmb=yFwQw@mail.gmail.com
обсуждение исходный текст
Ответы Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)  (Vik Fearing <vik@postgresfriends.org>)
Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)  (Justin Pryzby <pryzby@telsasoft.com>)
Список 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).

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ilya Anfimov
Дата:
Сообщение: Re: Should AT TIME ZONE be volatile?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: ALTER TABLE DETACH PARTITION violates serializability