Show names of DEALLOCATE as constants in pg_stat_statements
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_stat_statements/expected/utility.out | modified | +41 −0 |
| contrib/pg_stat_statements/pg_stat_statements.c | modified | +2 −6 |
| contrib/pg_stat_statements/sql/utility.sql | modified | +13 −0 |
| src/backend/parser/gram.y | modified | +8 −0 |
| src/include/nodes/parsenodes.h | modified | +6 −2 |
Discussion
- Ignore 2PC transaction GIDs in query jumbling 15 messages · 2023-08-01 → 2023-08-27