Add stats_reset to pg_stat_user_functions
Michael Paquier <michael@paquier.xyz>
Add stats_reset to pg_stat_user_functions It is possible to call pg_stat_reset_single_function_counters() for a single function, but the reset time was missing the system view showing its statistics. Like all the fields of pg_stat_user_functions, the GUC track_functions needs to be enabled to show the statistics about function executions. Bump catalog version. Bump PGSTAT_FILE_FORMAT_ID, as a result of the new field added to PgStat_StatFuncEntry. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/aONjnsaJSx-nEdfU@paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +9 −0 |
| src/backend/catalog/system_views.sql | modified | +2 −1 |
| src/backend/utils/activity/pgstat.c | modified | +1 −0 |
| src/backend/utils/activity/pgstat_function.c | modified | +6 −0 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +18 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +4 −0 |
| src/include/pgstat.h | modified | +2 −1 |
| src/include/utils/pgstat_internal.h | modified | +1 −0 |
| src/test/isolation/expected/stats_1.out | modified | +19 −1 |
| src/test/isolation/expected/stats.out | modified | +19 −1 |
| src/test/isolation/specs/stats.spec | modified | +6 −2 |
| src/test/regress/expected/rules.out | modified | +2 −1 |
Discussion
- Add stats_reset to pg_stat_all_tables|indexes and related views 13 messages · 2025-10-02 → 2025-10-08