From c75cbcc1aec7a3020265db1c07a21d1f766c4ef0 Mon Sep 17 00:00:00 2001 From: Sami Imseih Date: Fri, 18 Apr 2025 14:13:22 -0500 Subject: [PATCH] Clarify when aborted rows are tracked for tuple related counters. It is not obvious from the statistics collector documentation that tuple-related counters are incremented even when a transaction aborts, except for the n_mod_since_analyze counter, which only counts committed rows. Update the documentation to clarify this behavior. --- doc/src/sgml/monitoring.sgml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 4265a22d4de3..c920516fde77 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -283,6 +283,10 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser stated above; instead they update continuously throughout the transaction. + + An aborted transaction will also increment tuple-related counters, unless otherwise noted. + + Some of the information in the dynamic statistics views shown in is security restricted. @@ -3952,7 +3956,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage n_live_tup bigint - Estimated number of live rows + Estimated number of live rows (updated by committed transactions, or by + VACUUM and VACUUM FULL) @@ -3961,7 +3966,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage n_dead_tup bigint - Estimated number of dead rows + Estimated number of dead rows (updated either by committed or aborted + transactions, or by VACUUM and VACUUM FULL) @@ -3970,7 +3976,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage n_mod_since_analyze bigint - Estimated number of rows modified since this table was last analyzed + Estimated number of rows modified (by committed transactions) since this table + was last analyzed