Re: VACUUM and ANALYZE Follow-Up - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: VACUUM and ANALYZE Follow-Up
Date
Msg-id 20041129230925.GC30997@dcc.uchile.cl
Whole thread Raw
In response to Re: VACUUM and ANALYZE Follow-Up  ("Mark Dexter" <MDEXTER@dexterchaney.com>)
List pgsql-general
On Mon, Nov 29, 2004 at 02:57:28PM -0800, Mark Dexter wrote:

> 1. Why run VACUUM on an empty table?

Another approach: you run VACUUM on an empty table to empty it.  If you
had a table with a lot of tuples, and ran DELETE on it, it will empty
after that, but it will be full of dead tuples.  So you have to VACUUM
it to reclaim space.

Of course it would be better to use TRUNCATE rather than DELETE, but
that doesn't always work (e.g. because the table has foreign keys).

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"This is a foot just waiting to be shot"                (Andrew Dunstan)

pgsql-general by date:

Previous
From: "Mark Dexter"
Date:
Subject: Re: VACUUM and ANALYZE Follow-Up
Next
From: Mage
Date:
Subject: Re: VACUUM and ANALYZE Follow-Up