Re: Open Item: Should non-text EXPLAIN always show properties?

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, James Coleman <jtc331(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: Open Item: Should non-text EXPLAIN always show properties?
Date: 2020-06-29 23:22:02
Message-ID: CAApHDvqDUs43+CU_To0jwKHOzM07G=abwQyz3YnPJiGa0LR61g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 26 Jun 2020 at 04:33, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Thu, Jun 25, 2020 at 8:42 AM James Coleman <jtc331(at)gmail(dot)com> wrote:
> >> Yesterday I'd replied [1] to Justin's proposal for this WRT
> >> incremental sort and expressed my opinion that including both
> >> unnecessarily (i.e., including disk when an in-memory sort was used)
> >> is undesirable and confusing and leads to shortcuts I believe to be
> >> bad habits when using the data programmatically.
>
> > +1.
>
> I think the policy about non-text output formats is "all applicable
> fields should be included automatically". But the key word there is
> "applicable". Are disk-sort numbers applicable when no disk sort
> happened?
>
> I think the right way to think about this is that we are building
> an output data structure according to a schema that should be fixed
> for any particular plan shape. If event X happened zero times in
> a given execution, but it could have happened in a different execution
> of the same plan, then we should print X with a zero count. If X
> could not happen period in this plan, we should omit X's entry.
>
> So the real question here is whether the disk vs memory decision is
> plan time vs run time. AFAIK it's run time, which leads me to think
> we ought to print the zeroes.

I think that's a pretty good way of thinking about it.

For the HashAgg case, the plan could end up spilling, so based on what
you've said, we should be printing those zeros as some other execution
of the same plan could spill.

If nobody objects to that very soon, then I'll go ahead and push the
changes for HashAgg's non-text EXPLAIN ANALYZE

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-06-29 23:57:03 Re: Hybrid Hash/Nested Loop joins and caching results from subplans
Previous Message Peter Eisentraut 2020-06-29 23:14:31 Re: pgstattuple: Have pgstattuple_approx accept TOAST tables