pg_stat_statements: Add counters for generic and custom plans
Michael Paquier <michael@paquier.xyz>
pg_stat_statements: Add counters for generic and custom plans This patch adds two new counters to pg_stat_statements: - generic_plan_calls - custom_plan_calls These counters track how many times a prepared statement was executed using a generic or custom plan, respectively, providing a global equivalent at query level, for top and non-top levels, of pg_prepared_statements whose data is restricted to a single session. This commit builds upon e125e360020a. The module is bumped to version 1.13. PGSS_FILE_HEADER is bumped as well, something that the latest patches touching the on-disk format of the PGSS file did not actually bother with since 2022.. Author: Sami Imseih <samimseih@gmail.com> Reviewed-by: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Nikolay Samokhvalov <nik@postgres.ai> Discussion: https://postgr.es/m/CAA5RZ0uFw8Y9GCFvafhC=OA8NnMqVZyzXPfv_EePOt+iv1T-qQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_stat_statements/expected/oldextversions.out | modified | +67 −0 |
| contrib/pg_stat_statements/expected/plancache.out | added | +224 −0 |
| contrib/pg_stat_statements/Makefile | modified | +2 −1 |
| contrib/pg_stat_statements/meson.build | modified | +2 −0 |
| contrib/pg_stat_statements/pg_stat_statements--1.12--1.13.sql | added | +78 −0 |
| contrib/pg_stat_statements/pg_stat_statements.c | modified | +45 −8 |
| contrib/pg_stat_statements/pg_stat_statements.control | modified | +1 −1 |
| contrib/pg_stat_statements/sql/oldextversions.sql | modified | +5 −0 |
| contrib/pg_stat_statements/sql/plancache.sql | added | +94 −0 |
| doc/src/sgml/pgstatstatements.sgml | modified | +18 −0 |
Discussion
- track generic and custom plans in pg_stat_statements 73 messages · 2025-03-05 → 2025-07-31