summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-10-06 15:31:21 +0900
committerMichael Paquier <michael@paquier.xyz>2025-10-06 15:31:21 +0900
commita5b543258aa29e181abe59b3183b685650d24651 (patch)
tree8b999d91455e1767dce8259428cc70426b7be0f4 /src/include/pgstat.h
parentc173aaff98f898564998c0f5e4df9b6fca8a0f9c (diff)
Add stats_reset to pg_stat_all_{tables,indexes} and related views
It is possible to call pg_stat_reset_single_table_counters() on a relation (index or table) but the reset time was missing from the system views showing their statistics. This commit adds the reset time as an attribute of pg_stat_all_tables, pg_stat_all_indexes, and other relations related to them. Bump catalog version. Bump PGSTAT_FILE_FORMAT_ID, as a result of the new field added to PgStat_StatTabEntry. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/aN8l182jKxEq1h9f@paquier.xyz
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index e4a59a30b8c..8e8adb01176 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -212,7 +212,7 @@ typedef struct PgStat_TableXactStatus
* ------------------------------------------------------------
*/
-#define PGSTAT_FILE_FORMAT_ID 0x01A5BCB7
+#define PGSTAT_FILE_FORMAT_ID 0x01A5BCB8
typedef struct PgStat_ArchiverStats
{
@@ -454,6 +454,8 @@ typedef struct PgStat_StatTabEntry
PgStat_Counter total_autovacuum_time;
PgStat_Counter total_analyze_time;
PgStat_Counter total_autoanalyze_time;
+
+ TimestampTz stat_reset_time;
} PgStat_StatTabEntry;
/* ------