Skip site navigation (1) Skip section navigation (2)

Re: VACUUM and ANALYZE Follow-Up

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Mark Dexter <MDEXTER(at)dexterchaney(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: VACUUM and ANALYZE Follow-Up
Date: 2004-11-29 23:09:25
Message-ID: 20041129230925.GC30997@dcc.uchile.cl (view raw or flat)
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
"This is a foot just waiting to be shot"                (Andrew Dunstan)

In response to

pgsql-general by date

Next:From: MageDate: 2004-11-29 23:34:02
Subject: Re: VACUUM and ANALYZE Follow-Up
Previous:From: Mark DexterDate: 2004-11-29 22:57:28
Subject: Re: VACUUM and ANALYZE Follow-Up

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group