Re: VACUUM FULL for performance

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Szymon Guz <mabewlun(at)gmail(dot)com>
Cc: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>, AI Rumman <rummandba(at)gmail(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: VACUUM FULL for performance
Date: 2010-10-07 13:39:58
Message-ID: 20101007093958.278f3c73.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Szymon Guz <mabewlun(at)gmail(dot)com>:

> 2010/10/7 Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
>
> > On Thu, 2010-10-07 at 17:38 +0600, AI Rumman wrote:
> > > MayVACUUM FULL on a table improve perfromance of the system?
> >
> > No, it will make things worse.
>
> That's not true, I'd rather say that it depends. The whole performance is
> not just about the vacuum full.

My experience:

VACUUM FULL is indicated under the following conditions:
* When routine vacuum has failed for a while due to some problem, or
there are indicators that vacuuming was not being done often enough
and that table bloat has gotten out of hand.
* A major, unusual event has occurred that has cause the # of dead rows
in a table to bloat far out of what happens with normal usage.

I also recommend reindexing any table that has been VACUUM FULLed.

As everyone else has mentioned, VACUUM FULL is not a silver bullet, and
is not _guaranteed_ to improve performance. There are also very few
cases where it's a good idea to do it as routine maintenance. However,
it is a tool that is useful at times, and it's worthwhile to understand
how it works.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2010-10-07 13:42:22 Re: pg_relation_size / could not open relation with OID #
Previous Message Szymon Guz 2010-10-07 13:33:38 Re: VACUUM FULL for performance