Re: "vacuum" and "cluster" - Mailing list pgsql-general

From Craig Ringer
Subject Re: "vacuum" and "cluster"
Date
Msg-id 480622D6.3000202@postnewspapers.com.au
Whole thread Raw
In response to "vacuum" and "cluster"  ("Jimmy Choi" <yhjchoi@gmail.com>)
Responses Re: "vacuum" and "cluster"  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Jimmy Choi wrote:
> Hello,
>
> Does running "cluster" remove the need to run "vacuum"?

My understanding is that `CLUSTER' creates a new table file, then swaps
it out for the old one.

http://www.postgresql.org/docs/8.3/static/sql-cluster.html

" During the cluster operation, a temporary copy of the table is created
that contains the table data in the index order. Temporary copies of
each index on the table are created as well. Therefore, you need free
space on disk at least equal to the sum of the table size and the index
sizes. "

It's not stated explicitly, but I'm pretty sure discussion here has
mentioned that too. Given that, VACUUM FULL on a just-CLUSTERed table
should be redundant.

The easy way to be sure is to use ANALYZE VERBOSE to examine the dead
row counts etc before and after each operation.

--
Craig Ringer

pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Master-master replication with PostgreSQL
Next
From: "Vance Maverick"
Date:
Subject: table as log (multiple writers and readers)