On Tue, Nov 11, 2025 at 12:48:39PM -0600, Nathan Bossart wrote:
> I think maintenance.sgml needs an update (specifically, the part about the
> insert threshold [0]).

Here is a first try.

-- 
nathan
>From d5dfbee7894f8ff67bea73be9caa818461fce6b1 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <[email protected]>
Date: Tue, 18 Nov 2025 14:17:30 -0600
Subject: [PATCH v1 1/1] fix insert vacuum docs

---
 doc/src/sgml/maintenance.sgml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 120bac8875f..f4f0433ef6f 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -934,12 +934,16 @@ vacuum threshold = Minimum(vacuum max threshold, vacuum 
base threshold + vacuum
     The table is also vacuumed if the number of tuples inserted since the last
     vacuum has exceeded the defined insert threshold, which is defined as:
 <programlisting>
-vacuum insert threshold = vacuum base insert threshold + vacuum insert scale 
factor * number of tuples
+vacuum insert threshold = vacuum base insert threshold + vacuum insert scale 
factor * number of tuples * percent of table not frozen
 </programlisting>
     where the vacuum insert base threshold is
     <xref linkend="guc-autovacuum-vacuum-insert-threshold"/>,
-    and vacuum insert scale factor is
-    <xref linkend="guc-autovacuum-vacuum-insert-scale-factor"/>.
+    the vacuum insert scale factor is
+    <xref linkend="guc-autovacuum-vacuum-insert-scale-factor"/>,
+    the number of tuples is
+    <structname>pg_class</structname>.<structfield>reltuples</structfield>,
+    and the percent of the table not frozen is
+    <literal>1 - pg_class.relallfrozen / pg_class.relpages</literal>.
     Such vacuums may allow portions of the table to be marked as
     <firstterm>all visible</firstterm> and also allow tuples to be frozen, 
which
     can reduce the work required in subsequent vacuums.
-- 
2.39.5 (Apple Git-154)

Reply via email to