From ae6ba13f4635e70cef32e863996aedfcdccef209 Mon Sep 17 00:00:00 2001
From: Sami Imseih <simseih@amazon.com>
Date: Thu, 10 Apr 2025 19:22:47 -0500
Subject: [PATCH v2 1/1] Clarify when aborted rows are tracked in
 pg_stat_all_tables/pg_stat_database

Update the documentation for the pg_stat_all_tables.n_tup_*, n_ins_since_vacuum,
and n_mod_since_analyze fields to reflect that these fields track both
committed and aborted transactions.
---
 doc/src/sgml/monitoring.sgml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c421d89edff..626b790ebbc 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3439,6 +3439,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Number of rows inserted by queries in this database
+       (including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3448,6 +3449,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Number of rows updated by queries in this database
+       (including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3457,6 +3459,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Number of rows deleted by queries in this database
+       (including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3892,7 +3895,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
        <structfield>n_tup_ins</structfield> <type>bigint</type>
       </para>
       <para>
-       Total number of rows inserted
+       Total number of rows inserted (including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3903,8 +3906,9 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       <para>
        Total number of rows updated.  (This includes row updates
        counted in <structfield>n_tup_hot_upd</structfield> and
-       <structfield>n_tup_newpage_upd</structfield>, and remaining
-       non-<acronym>HOT</acronym> updates.)
+       <structfield>n_tup_newpage_upd</structfield>, as well as
+       remaining non-<acronym>HOT</acronym> updates and rows updated
+       in aborted transactions.)
       </para></entry>
      </row>
 
@@ -3913,7 +3917,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
        <structfield>n_tup_del</structfield> <type>bigint</type>
       </para>
       <para>
-       Total number of rows deleted
+       Total number of rows deleted (including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3966,6 +3970,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Estimated number of rows modified since this table was last analyzed
+       (not including rows from aborted transactions)
       </para></entry>
      </row>
 
@@ -3975,6 +3980,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Estimated number of rows inserted since this table was last vacuumed
+       (including rows from aborted transactions)
       </para></entry>
      </row>
 
-- 
2.39.5 (Apple Git-154)

