doc: Update formula for vacuum insert threshold.
authorNathan Bossart <[email protected]>
Wed, 19 Nov 2025 16:01:37 +0000 (10:01 -0600)
committerNathan Bossart <[email protected]>
Wed, 19 Nov 2025 16:01:37 +0000 (10:01 -0600)
Oversight in commit 06eae9e621.

Reviewed-by: Melanie Plageman <[email protected]>
Discussion: https://postgr.es/m/aRODeqFUVkGDJSPP%40nathan
Backpatch-through: 18

doc/src/sgml/maintenance.sgml

index e7a9f58c01582b343de5cc598aea4e51ef3f9081..1571a895fc8124211f60161db71009994bbea56d 100644 (file)
@@ -933,12 +933,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.