Re: shrinking physical space used

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bopolissimus Platypus Jr <bopolissimus(dot)lists(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: shrinking physical space used
Date: 2004-11-14 14:35:55
Message-ID: 20041114143551.GA23372@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Nov 14, 2004 at 01:50:10PM +0800, Bopolissimus Platypus Jr wrote:
> hello all,
>
> i've got a database that takes up 4G of space. when i run a script that
> deletes all rows and then vacuum, the data directory gets down to
> around 3-3.5G. what i'd like is to get a blank database structure that
> really contains no data at all, or any unused space at all. apparently
> that's not what i'm getting now. is there a way to get this apart from
> dump, initdb, restore? i figure that if i could dump/initdb/restore i'd
> probably get a data directory with around 30MB only.

Perhaps you should use TRUNCATE (the SQL command) rather than DELETE.
It'll probably work better... You're probably still seeing the space
the indexes are using.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2004-11-14 15:14:03 Re: I'm about to release the next postgresql RFD.
Previous Message Gary L. Burnore 2004-11-14 14:06:34 Re: I'm about to release the next postgresql RFD.