pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make auto_explain print the query identifier in verbose mode
Date: Thu, 26 Jan 2023 03:25:27 +0000
Message-ID: <E1pKstD-005Vi6-JK@gemulon.postgresql.org> (raw)

Make auto_explain print the query identifier in verbose mode

When auto_explain.log_verbose is on, auto_explain should print in the
logs plans equivalent to the EXPLAIN (VERBOSE).  However, when
compute_query_id is on, query identifiers were not showing up, being
only handled by EXPLAIN (VERBOSE).  This brings auto_explain on par with
EXPLAIN regarding that.  Note that like EXPLAIN, auto_explain does not
show the query identifier when compute_query_id=regress.

The change is done so as the choice of printing the query identifier is
done in ExplainPrintPlan() rather than in ExplainOnePlan(), to avoid a
duplication of the logic dealing with the query ID.  auto_explain is the
only in-core caller of ExplainPrintPlan().

While looking at the area, I have noticed that more consolidation
between EXPLAIN and auto_explain would be in order for the logging of
the plan duration and the buffer usage.  This refactoring is left as a
future change.

Author: Atsushi Torikoshi
Reviewed-by: Justin Pryzby, Julien Rouhaud
Discussion: https://postgr.es/m/1ea21936981f161bccfce05765c03bee@oss.nttdata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d2d9728b8d546434aade4f9667a59666588edd6

Modified Files
--------------
contrib/auto_explain/t/001_auto_explain.pl | 29 +++++++++++++++++++++++++++
src/backend/commands/explain.c             | 32 +++++++++++++++---------------
2 files changed, 45 insertions(+), 16 deletions(-)



Message-ID: <E1pKstD-005Vi6-JK@gemulon.postgresql.org>
Permalink:  ../E1pKstD-005Vi6-JK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pKstD-005Vi6-JK@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Make auto_explain print the query identifier in verbose mode
  In-Reply-To: <E1pKstD-005Vi6-JK@gemulon.postgresql.org>
  References: <E1pKstD-005Vi6-JK@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox