From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Show names of DEALLOCATE as constants in pg_stat_statements
Date: Sun, 27 Aug 2023 08:29:27 +0000
Message-ID: <E1qaB9D-0019AH-Ih@gemulon.postgresql.org> (raw)
Show names of DEALLOCATE as constants in pg_stat_statements
This commit switches query jumbling so as prepared statement names are
treated as constants in DeallocateStmt. A boolean field is added to
DeallocateStmt to make a distinction between ALL and named prepared
statements, as "name" was used to make this difference before, NULL
meaning DEALLOCATE ALL.
Prior to this commit, DEALLOCATE was not tracked in pg_stat_statements,
for the reason that it was not possible to treat its name parameter as a
constant. Now that query jumbling applies to all the utility nodes,
this reason does not apply anymore.
Like 638d42a3c520, this can be a huge advantage for monitoring where
prepared statement names are randomly generated, preventing bloat in
pg_stat_statements. A couple of tests are added to track the new
behavior.
Author: Dagfinn Ilmari Mannsåker, Michael Paquier
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/ZMhT9kNtJJsHw6jK@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/bb45156f342c2cdb88cdd7f9efdc4541e910ec86
Modified Files
--------------
contrib/pg_stat_statements/expected/utility.out | 41 +++++++++++++++++++++++++
contrib/pg_stat_statements/pg_stat_statements.c | 8 ++---
contrib/pg_stat_statements/sql/utility.sql | 13 ++++++++
src/backend/parser/gram.y | 8 +++++
src/include/nodes/parsenodes.h | 8 +++--
5 files changed, 70 insertions(+), 8 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Show names of DEALLOCATE as constants in pg_stat_statements
In-Reply-To: <E1qaB9D-0019AH-Ih@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