Re: [PG13] Planning (time + buffers) data structure in explain plan (format text) - Mailing list pgsql-hackers

From David Rowley
Subject Re: [PG13] Planning (time + buffers) data structure in explain plan (format text)
Date
Msg-id CAApHDvrqFR8EHzOJ7feFxhP5Xpx+7xX6y_cd5PDUZf_Ka6j-5w@mail.gmail.com
Whole thread Raw
In response to Re: [PG13] Planning (time + buffers) data structure in explain plan (format text)  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
On Thu, 20 Aug 2020 at 03:31, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
>
>
> On 2020/08/19 19:39, David Rowley wrote:
> > On Wed, 19 Aug 2020 at 21:05, Julien Rouhaud <rjuju123@gmail.com> wrote:
> >>
> >> On Wed, Aug 19, 2020 at 08:49:48PM +1200, David Rowley wrote:
> >>> However, I'm not quite sure how we should handle if someone does:
> >>> EXPLAIN (BUFFERS on, SUMMARY off). Without the summary, there's no
> >>> place to print the buffers, which seems bad as they asked for buffers.
> >>
> >>
> >> But this won't be as much a problem if ANALYZE is asked, and having different
> >> behaviors isn't appealing.  So maybe it's better to let people get what they
> >> asked for even if that's contradictory?
> >
> > I'd say BUFFERS on, BUFFERS off is contradictory. I don't think
> > BUFFERS, SUMMARY OFF is. It's just that we show the buffer details for
> > the planner in the summary.  Since "summary" is not exactly a word
> > that describes what you're asking EXPLAIN to do, I wouldn't blame
> > users if they got confused as to why their BUFFERS on request was not
> > displayed.
>
> Displaying the planner's buffer usage under summary is the root cause of
> the confusion? If so, what about displaying that outside summary?
> Attached is the POC patch that I'm just thinking.

I had a look at this and I like it better than what I proposed earlier.

The change to show_buffer_usage() is a bit ugly, but I'm not really
seeing a better way to do it. Perhaps that can be improved later if we
ever find that there's some other special case to add.

David



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Optimising compactify_tuples()
Next
From: David Rowley
Date:
Subject: Re: Hybrid Hash/Nested Loop joins and caching results from subplans