From 8766671e9de5fff2cc7fa39bfc64bf14b12b9674 Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Sat, 22 Apr 2023 11:44:45 -0700 Subject: [PATCH v4 6/9] Merge "basic vacuuming" sect2 into sect1 introduction. This doesn't change any of the content itself. It just merges the original text into the sect1 text that immediately preceded it. This is preparation for the next commit, which will remove most of the text "relocated" in this commit. This structure should make things a little easier for doc translators. --- doc/src/sgml/maintenance.sgml | 106 ++++++++++++++++------------------ 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 970c4a848..3f5b83b14 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -265,68 +265,64 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu to skim this material to help them understand and adjust autovacuuming. - - Vacuuming Basics + + PostgreSQL's + VACUUM command has to + process each table on a regular basis for several reasons: - - PostgreSQL's - VACUUM command has to - process each table on a regular basis for several reasons: + + + To recover or reuse disk space occupied by updated or deleted + rows. + - - - To recover or reuse disk space occupied by updated or deleted - rows. - + + To protect against loss of very old data due to + transaction ID wraparound or + multixact ID wraparound. + - - To protect against loss of very old data due to - transaction ID wraparound or - multixact ID wraparound. - + + To update the visibility map, which speeds + up index-only + scans. + - - To update the visibility map, which speeds - up index-only - scans. - + + To update data statistics used by the + PostgreSQL query planner. + + - - To update data statistics used by the - PostgreSQL query planner. - - + Each of these reasons dictates performing VACUUM operations + of varying frequency and scope, as explained in the following subsections. + - Each of these reasons dictates performing VACUUM operations - of varying frequency and scope, as explained in the following subsections. - + + There are two variants of VACUUM: standard VACUUM + and VACUUM FULL. VACUUM FULL can reclaim more + disk space but runs much more slowly. Also, + the standard form of VACUUM can run in parallel with production + database operations. (Commands such as SELECT, + INSERT, UPDATE, and + DELETE will continue to function normally, though you + will not be able to modify the definition of a table with commands such as + ALTER TABLE while it is being vacuumed.) + VACUUM FULL requires an + ACCESS EXCLUSIVE lock on the table it is + working on, and therefore cannot be done in parallel with other use + of the table. Generally, therefore, + administrators should strive to use standard VACUUM and + avoid VACUUM FULL. + - - There are two variants of VACUUM: standard VACUUM - and VACUUM FULL. VACUUM FULL can reclaim more - disk space but runs much more slowly. Also, - the standard form of VACUUM can run in parallel with production - database operations. (Commands such as SELECT, - INSERT, UPDATE, and - DELETE will continue to function normally, though you - will not be able to modify the definition of a table with commands such as - ALTER TABLE while it is being vacuumed.) - VACUUM FULL requires an - ACCESS EXCLUSIVE lock on the table it is - working on, and therefore cannot be done in parallel with other use - of the table. Generally, therefore, - administrators should strive to use standard VACUUM and - avoid VACUUM FULL. - - - - VACUUM creates a substantial amount of I/O - traffic, which can cause poor performance for other active sessions. - There are configuration parameters that can be adjusted to reduce the - performance impact of background vacuuming — see - . - - + + VACUUM creates a substantial amount of I/O + traffic, which can cause poor performance for other active sessions. + There are configuration parameters that can be adjusted to reduce the + performance impact of background vacuuming — see + . + Recovering Disk Space -- 2.40.1