Thread: VACUUM FULL
Hello everyone, I've done VACUUM FULL on my db and noticed that it reclaimed considerably more diskspace than regular VACUUM. Should I use VACUUM FULL or not? Are there any downsides/risks to it (other than that it locks the table while vacuuming)? Conversely, are there any performance advantages of db after doing VACUUM FULL? The docs on VACUUM FULL do not say what it does exactly (in detail).. Regards, Marcin Krol
Hi,
The manual contains:
There are two variants of the VACUUM command. The first form, known as "lazy vacuum" or just
VACUUM, marks dead data in tables and indexes for future reuse; it does not attempt to reclaim the
space used by this dead data unless the space is at the end of the table and an exclusive table lock
can be easily obtained. Unused space at the start or middle of the file does not result in the file being
shortened and space returned to the operating system. This variant of VACUUM can be run concurrently
with normal database operations.
The second form is the VACUUM FULL command. This uses a more aggressive algorithm for reclaiming
the space consumed by dead row versions. Any space that is freed by VACUUM FULL is immediately
returned to the operating system, and the table data is physically compacted on the disk.
Unfortunately, this variant of the VACUUM command acquires an exclusive lock on each table while
VACUUM FULL is processing it. Therefore, frequently using VACUUM FULL can have an extremely
negative effect on the performance of concurrent database queries.
Does this answer your question?
Regards,
Serge Fonville
On Wed, Nov 5, 2008 at 2:47 PM, Marcin Krol <mrkafk@gmail.com> wrote:
Hello everyone,
I've done VACUUM FULL on my db and noticed that it reclaimed considerably more diskspace than regular VACUUM.
Should I use VACUUM FULL or not? Are there any downsides/risks to it (other than that it locks the table while vacuuming)?
Conversely, are there any performance advantages of db after doing VACUUM FULL?
The docs on VACUUM FULL do not say what it does exactly (in detail)..
Regards,
Marcin Krol
--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice