pgsql: Fix some infelicities in EXPLAIN output for parallel query plans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some infelicities in EXPLAIN output for parallel query plans
Date: 2016-06-29 22:51:27
Message-ID: E1bIOKN-0004Gi-6e@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix some infelicities in EXPLAIN output for parallel query plans.

In non-text output formats, parallelized aggregates were reporting
"Partial" or "Finalize" as a field named "Operation", which might be all
right in the absence of any context --- but other plan node types use that
field to report SQL-visible semantics, such as Select/Insert/Update/Delete.
So that naming choice didn't seem good to me. I changed it to "Partial
Mode".

Also, the field did not appear at all for a non-parallelized Agg plan node,
which is contrary to expectation in non-text formats. We're notionally
producing objects that conform to a schema, so the set of fields for a
given node type and EXPLAIN mode should be well-defined. I set it up to
fill in "Simple" in such cases.

Other fields that were added for parallel query, namely "Parallel Aware"
and Gather's "Single Copy", had not gotten the word on that point either.
Make them appear always in non-text output.

Also, the latter two fields were nominally producing boolean output, but
were getting it wrong, because bool values shouldn't be quoted in JSON or
YAML. Somehow we'd not needed an ExplainPropertyBool formatting subroutine
before 9.6; but now we do, so invent it.

Discussion: <16002(dot)1466972724(at)sss(dot)pgh(dot)pa(dot)us>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8ebb69f85445177575684a0ba5cfedda8d840a91

Modified Files
--------------
src/backend/commands/explain.c | 42 ++++++++++++++++++---------
src/include/commands/explain.h | 2 ++
src/test/regress/expected/insert_conflict.out | 4 ++-
3 files changed, 33 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-06-29 23:07:24 pgsql: Dodge compiler bug in Visual Studio 2013.
Previous Message Tom Lane 2016-06-29 21:13:34 pgsql: Update rules.out to match commit 9ed551e0a.