From: Bruce Momjian <bruce@momjian.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make use of in-core query id added by commit 5fd9dfa5f5
Date: Wed, 07 Apr 2021 18:04:09 +0000
Message-ID: <E1lUCXB-0001Ll-3H@gemulon.postgresql.org> (raw)
Make use of in-core query id added by commit 5fd9dfa5f5
Use the in-core query id computation for pg_stat_activity,
log_line_prefix, and EXPLAIN VERBOSE.
Similar to other fields in pg_stat_activity, only the queryid from the
top level statements are exposed, and if the backends status isn't
active then the queryid from the last executed statements is displayed.
Add a %Q placeholder to include the queryid in log_line_prefix, which
will also only expose top level statements.
For EXPLAIN VERBOSE, if a query identifier has been computed, either by
enabling compute_query_id or using a third-party module, display it.
Bump catalog version.
Discussion: https://postgr.es/m/20210407125726.tkvjdbw76hxnpwfi@nol
Author: Julien Rouhaud
Reviewed-by: Alvaro Herrera, Nitin Jadhav, Zhihong Yu
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4f0b0966c866ae9f0e15d7cc73ccf7ce4e1af84b
Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c | 112 ++++++++++--------------
doc/src/sgml/config.sgml | 29 ++++--
doc/src/sgml/monitoring.sgml | 16 ++++
doc/src/sgml/ref/explain.sgml | 6 +-
src/backend/catalog/system_views.sql | 1 +
src/backend/commands/explain.c | 18 ++++
src/backend/executor/execMain.c | 9 ++
src/backend/executor/execParallel.c | 5 +-
src/backend/parser/analyze.c | 5 ++
src/backend/tcop/postgres.c | 5 ++
src/backend/utils/activity/backend_status.c | 68 ++++++++++++++
src/backend/utils/adt/pgstatfuncs.c | 7 +-
src/backend/utils/error/elog.c | 8 ++
src/backend/utils/misc/postgresql.conf.sample | 1 +
src/backend/utils/misc/queryjumble.c | 27 +++---
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 6 +-
src/include/utils/backend_status.h | 5 ++
src/test/regress/expected/explain.out | 11 ++-
src/test/regress/expected/rules.out | 9 +-
src/test/regress/sql/explain.sql | 5 +-
21 files changed, 250 insertions(+), 105 deletions(-)
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: bruce@momjian.us
Subject: Re: pgsql: Make use of in-core query id added by commit 5fd9dfa5f5
In-Reply-To: <E1lUCXB-0001Ll-3H@gemulon.postgresql.org>
References: <E1lUCXB-0001Ll-3H@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