Re: TRUNCATE Question

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: TRUNCATE Question
Date: 2005-11-10 02:38:20
Message-ID: 20051110023820.GA89826@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 10, 2005 at 01:16:24PM +1100, Alex wrote:
> could anyone tell me if it is necessary to run a Vacuum after truncating
> a table or is that done automatically.

http://www.postgresql.org/docs/8.0/interactive/maintenance.html#VACUUM-FOR-SPACE-RECOVERY

"If you have a table whose contents are deleted on a periodic basis,
consider doing it with TRUNCATE rather than using DELETE followed by
VACUUM. TRUNCATE removes the entire content of the table immediately,
without requiring a subsequent VACUUM or VACUUM FULL to reclaim the
now-unused disk space."

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2005-11-10 08:09:05 Re: [ANNOUNCE] PostgreSQL 8.1.0 RPMs are available for download
Previous Message Tom Lane 2005-11-10 02:33:04 Re: TRUNCATE Question