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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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