Show GIDs of two-phase commit commands as constants in pg_stat_statements
commit638d42a3c52081cf4882520f0622161bad69b40f
authorMichael Paquier <michael@paquier.xyz>
Sat, 12 Aug 2023 01:44:15 +0000 (12 10:44 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 12 Aug 2023 01:44:15 +0000 (12 10:44 +0900)
tree397a7b97a73df3a82476b948374fa115028f278b
parent5dc456b7dda4f7d0d7735b066607c190c74d174a
Show GIDs of two-phase commit commands as constants in pg_stat_statements

This relies on the "location" field added to TransactionStmt in 31de7e6,
now applied to the "gid" field used by 2PC commands.  These commands are
now reported like:
COMMIT PREPARED $1
PREPARE TRANSACTION $1
ROLLBACK PREPARED $1

Applying constants for these commands is a huge advantage for workloads
that rely a lot on 2PC commands with different GIDs.  Some tests are
added to track the new behavior.

Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/ZMhT9kNtJJsHw6jK@paquier.xyz
contrib/pg_stat_statements/expected/utility.out
contrib/pg_stat_statements/pg_stat_statements.conf
contrib/pg_stat_statements/sql/utility.sql
src/backend/parser/gram.y
src/include/nodes/parsenodes.h