Re: Growing Database Size - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Growing Database Size
Date
Msg-id 20030616060158.GB40542@flake.decibel.org
Whole thread Raw
In response to Re: Growing Database Size  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Responses Re: Growing Database Size
List pgsql-general
On Sun, Jun 15, 2003 at 04:05:59PM +0530, Shridhar Daithankar wrote:
> On 14 Jun 2003 at 13:50, Kenneth Godee wrote:
> How about
>
> begin
> drop table a;
> drop table b;
> create table a;
> create table b;
> copy -> table a;
> copy ->table b;
> commit;
> vacuum analyze;
>
> I can almost bet that this would be faster than solution above as it would not
> churn the disk as much, put simply.
>
> Hmm..Just wondering, will truncate in above steps would do the same job?

Yes, truncate table would do the same job and more importantly, wouldn't
go mucking about in the catalog tables. Assuming it's available in 7.2,
you should absolutely use truncate instead of drop/create (man I wish
more databases supported truncate).
--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [HACKERS] UTF8 and KOI8 mini-howto
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Why can't you define a table alias on an update?