Re: Vacuum and Vacuum analyze

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Chris Boget <chris(at)wild(dot)net>
Cc: PGSql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Vacuum and Vacuum analyze
Date: 2003-06-30 14:01:04
Message-ID: 20030630140104.GB26591@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Jun 30, 2003 at 08:49:28 -0500,
Chris Boget <chris(at)wild(dot)net> wrote:
>
> So that begs the question (from a newbie), when should these
> commands, 'vacuum' and 'vacuum analyze' be run and how
> often?

The purpose of vacuum is to allow the space used by deleted (included
old versions of updated tuples) to be reused. You want to do this once
a significant fraction of your database is taken up by deleted tuples.

The purpose of analyze is to provide statistics to the planner so that
a good plan for handling queries. You generally need to run analyze
after the number of rows or distribution of your data changes signicantly.
Doing an initial load is a significant change.

You can run these commands on just some of your tables. This is helpful
when you have a large database where some tables change differently than
others.

Have you read the admin part of the documentation yet?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel Phlander 2003-06-30 15:33:50 db problem
Previous Message Bruno Wolff III 2003-06-30 13:54:11 Re: Noobie: Problems with a query