Re: display of variables in EXPLAIN VERBOSE - Mailing list pgsql-hackers

From David Rowley
Subject Re: display of variables in EXPLAIN VERBOSE
Date
Msg-id CAKJS1f-LMkZ1WietC4ewaM8s8iJ5maCfwd1BxDX6aK5FkEfYKA@mail.gmail.com
Whole thread Raw
In response to display of variables in EXPLAIN VERBOSE  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: display of variables in EXPLAIN VERBOSE
List pgsql-hackers
On Mon, 22 Apr 2019 at 19:49, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> Seeing that "Sort Key" is always displayed with the range table alias, I
> checked explain.c to see why the discrepancy exists and it seems that
> show_plan_tlist() (and show_tablesample()) use the following condition for
> whether or not to use the range table prefix:
>
>     useprefix = list_length(es->rtable) > 1;
>
> whereas other functions, including show_sort_group_keys() that prints the
> "Sort Key", use the following condition:
>
>     useprefix = (list_length(es->rtable) > 1 || es->verbose);
>
> I can think of two ways we could do:
>
> 1. Change show_plan_tlist() and show_tablesample() to use the same rule as
> others
>
> 2. Change other functions to use the same rule as show_plan_tlist(), also
> updating the documentation to note the exceptional case when column names
> are not prefixed

I'd vote to make the code match the documentation, but probably
implement it by adding a new field to ExplainState and just calculate
what to do once in ExplainQuery() instead of calculating what to do in
various random places.

I don't think we should backpatch this change, likely it would be
better to keep the explain output as stable as possible in the back
branches, so that might mean a documentation tweak should be done for
them.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Unhappy about API changes in the no-fsm-for-small-rels patch
Next
From: Robert Haas
Date:
Subject: Re: Do CustomScan as not projection capable node