aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/maintenance.sgml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/maintenance.sgml')
-rw-r--r--doc/src/sgml/maintenance.sgml33
1 files changed, 25 insertions, 8 deletions
diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index f84ad7557d9..b5b9da7f8a9 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -496,9 +496,25 @@
When that happens, <command>VACUUM</command> will eventually need to perform an
<firstterm>aggressive vacuum</firstterm>, which will freeze all eligible unfrozen
XID and MXID values, including those from all-visible but not all-frozen pages.
- In practice most tables require periodic aggressive vacuuming.
+ </para>
+
+ <para>
+ If a table is building up a backlog of all-visible but not all-frozen
+ pages, a normal vacuum may choose to scan skippable pages in an effort to
+ freeze them. Doing so decreases the number of pages the next aggressive
+ vacuum must scan. These are referred to as <firstterm>eagerly
+ scanned</firstterm> pages. Eager scanning can be tuned to attempt to freeze
+ more all-visible pages by increasing <xref
+ linkend="guc-vacuum-max-eager-freeze-failure-rate"/>. Even if eager
+ scanning has kept the number of all-visible but not all-frozen pages to a
+ minimum, most tables still require periodic aggressive vacuuming. However,
+ any pages successfully eager frozen may be skipped during an aggressive
+ vacuum, so eager freezing may minimize the overhead of aggressive vacuums.
+ </para>
+
+ <para>
<xref linkend="guc-vacuum-freeze-table-age"/>
- controls when <command>VACUUM</command> does that: all-visible but not all-frozen
+ controls when a table is aggressively vacuumed. All all-visible but not all-frozen
pages are scanned if the number of transactions that have passed since the
last such scan is greater than <varname>vacuum_freeze_table_age</varname> minus
<varname>vacuum_freeze_min_age</varname>. Setting
@@ -626,10 +642,12 @@ SELECT datname, age(datfrozenxid) FROM pg_database;
</tip>
<para>
- <command>VACUUM</command> normally only scans pages that have been modified
- since the last vacuum, but <structfield>relfrozenxid</structfield> can only be
- advanced when every page of the table
- that might contain unfrozen XIDs is scanned. This happens when
+ While <command>VACUUM</command> scans mostly pages that have been
+ modified since the last vacuum, it may also eagerly scan some
+ all-visible but not all-frozen pages in an attempt to freeze them, but
+ the <structfield>relfrozenxid</structfield> will only be advanced when
+ every page of the table that might contain unfrozen XIDs is scanned.
+ This happens when
<structfield>relfrozenxid</structfield> is more than
<varname>vacuum_freeze_table_age</varname> transactions old, when
<command>VACUUM</command>'s <literal>FREEZE</literal> option is used, or when all
@@ -931,8 +949,7 @@ vacuum insert threshold = vacuum base insert threshold + vacuum insert scale fac
If the <structfield>relfrozenxid</structfield> value of the table
is more than <varname>vacuum_freeze_table_age</varname> transactions old,
an aggressive vacuum is performed to freeze old tuples and advance
- <structfield>relfrozenxid</structfield>; otherwise, only pages that have been modified
- since the last vacuum are scanned.
+ <structfield>relfrozenxid</structfield>.
</para>
<para>