Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE
Date: 2024-11-05 18:45:03
Message-ID: CA+TgmoYCH82V680Z+SK2h-wSsuEj_FOiHdHxVM-TdQxHrqdbZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 5, 2024 at 1:24 PM Nikolay Samokhvalov
<samokhvalov(at)gmail(dot)com> wrote:
> Item 3 is already solved, as it turned out.

ANALYZE and VERBOSE are treated specially because those options
existed prior to the parenthesized syntax. Scaling that treatment to a
large number of options will not work out.

> Let's focus on item 2. Is it really impossible to make VERBOSE really verbose?

It is, of course, not impossible. But the fact that something is
possible does not necessarily mean that it is a good idea. I think it
can be quite confusing when the same behavior is controlled in more
than one way. If the VERBOSE option turns information about BUFFERS on
and off, and the BUFFERS option does the same thing, what happens if I
say EXPLAIN (VERBOSE ON, BUFFERS OFF)? Is it different if I say
EXPLAIN (BUFFERS OFF, VERBOSE ON)? There's a lot of opportunity for
the behavior to be confusing here. Then, too, we can argue about what
should be included in VERBOSE. You propose BUFFERS and SETTINGS, but
we've also got SERIALIZE (which is not even Boolean-valued), WAL, and
MEMORY. One can argue that we ought to include everything when VERBOSE
is specified; one can also argue that some of this stuff is too
marginal and too high-overhead to justify its inclusion. Both
arguments have merit, IMHO.

I'm not very happy with the current situation. I agree that EXPLAIN
has gotten a bit too complicated. However, I also know that not
everyone wants the same things. And I can say from a PostgreSQL
support perspective that I do not always want a customer to just "turn
on everything", as EXPLAIN output can be extremely long and adding a
whole bunch of additional details that make already-long output even
longer can easily be actively unhelpful. For me personally, just plain
EXPLAIN ANALYZE is usually enough. Sometimes I need VERBOSE to see the
target lists at each level, and very occasionally I need BUFFERS to
see how much data is being accessed, but at least for me, those are
pretty rare cases. So I don't think I really believe the "everybody
always wants that" argument. One of the most common things that I have
to do with EXPLAIN output is trim the small amounts of relevant
material out of the giant pile of things that don't matter to the
problem at hand. If you enable an option that adds an extra line of
output for every node and there are 100 nodes in the query plan, that
is a whole lot of additional clutter.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2024-11-05 18:56:33 Re: UUID v7
Previous Message David G. Johnston 2024-11-05 18:33:43 Re: Rename Function: pg_postmaster_start_time