Skip site navigation (1) Skip section navigation (2)

Re: VACUUM FULL

From: "Serge Fonville" <serge(dot)fonville(at)gmail(dot)com>
To: "Marcin Krol" <mrkafk(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: VACUUM FULL
Date: 2008-11-05 14:06:17
Message-ID: 680cbe0e0811050606u61882abfk9c704d593697cff7@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
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(at)gmail(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2008-11-05 15:28:12
Subject: Re: Does pg_dumpall support BLOBs?
Previous:From: Marcin KrolDate: 2008-11-05 13:47:47
Subject: VACUUM FULL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group