|
496 | 496 | When that happens, <command>VACUUM</command> will eventually need to perform an
|
497 | 497 | <firstterm>aggressive vacuum</firstterm>, which will freeze all eligible unfrozen
|
498 | 498 | XID and MXID values, including those from all-visible but not all-frozen pages.
|
499 |
| - In practice most tables require periodic aggressive vacuuming. |
| 499 | + </para> |
| 500 | + |
| 501 | + <para> |
| 502 | + If a table is building up a backlog of all-visible but not all-frozen |
| 503 | + pages, a normal vacuum may choose to scan skippable pages in an effort to |
| 504 | + freeze them. Doing so decreases the number of pages the next aggressive |
| 505 | + vacuum must scan. These are referred to as <firstterm>eagerly |
| 506 | + scanned</firstterm> pages. Eager scanning can be tuned to attempt to freeze |
| 507 | + more all-visible pages by increasing <xref |
| 508 | + linkend="guc-vacuum-max-eager-freeze-failure-rate"/>. Even if eager |
| 509 | + scanning has kept the number of all-visible but not all-frozen pages to a |
| 510 | + minimum, most tables still require periodic aggressive vacuuming. However, |
| 511 | + any pages successfully eager frozen may be skipped during an aggressive |
| 512 | + vacuum, so eager freezing may minimize the overhead of aggressive vacuums. |
| 513 | + </para> |
| 514 | + |
| 515 | + <para> |
500 | 516 | <xref linkend="guc-vacuum-freeze-table-age"/>
|
501 |
| - controls when <command>VACUUM</command> does that: all-visible but not all-frozen |
| 517 | + controls when a table is aggressively vacuumed. All all-visible but not all-frozen |
502 | 518 | pages are scanned if the number of transactions that have passed since the
|
503 | 519 | last such scan is greater than <varname>vacuum_freeze_table_age</varname> minus
|
504 | 520 | <varname>vacuum_freeze_min_age</varname>. Setting
|
@@ -626,10 +642,12 @@ SELECT datname, age(datfrozenxid) FROM pg_database;
|
626 | 642 | </tip>
|
627 | 643 |
|
628 | 644 | <para>
|
629 |
| - <command>VACUUM</command> normally only scans pages that have been modified |
630 |
| - since the last vacuum, but <structfield>relfrozenxid</structfield> can only be |
631 |
| - advanced when every page of the table |
632 |
| - that might contain unfrozen XIDs is scanned. This happens when |
| 645 | + While <command>VACUUM</command> scans mostly pages that have been |
| 646 | + modified since the last vacuum, it may also eagerly scan some |
| 647 | + all-visible but not all-frozen pages in an attempt to freeze them, but |
| 648 | + the <structfield>relfrozenxid</structfield> will only be advanced when |
| 649 | + every page of the table that might contain unfrozen XIDs is scanned. |
| 650 | + This happens when |
633 | 651 | <structfield>relfrozenxid</structfield> is more than
|
634 | 652 | <varname>vacuum_freeze_table_age</varname> transactions old, when
|
635 | 653 | <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
|
931 | 949 | If the <structfield>relfrozenxid</structfield> value of the table
|
932 | 950 | is more than <varname>vacuum_freeze_table_age</varname> transactions old,
|
933 | 951 | an aggressive vacuum is performed to freeze old tuples and advance
|
934 |
| - <structfield>relfrozenxid</structfield>; otherwise, only pages that have been modified |
935 |
| - since the last vacuum are scanned. |
| 952 | + <structfield>relfrozenxid</structfield>. |
936 | 953 | </para>
|
937 | 954 |
|
938 | 955 | <para>
|
|
0 commit comments