Re: Growing Database Size

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Growing Database Size
Date: 2003-06-16 06:01:58
Message-ID: 20030616060158.GB40542@flake.decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)nasby(dot)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?"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2003-06-16 06:06:13 Re: Why can't you define a table alias on an update?
Previous Message Oleg Bartunov 2003-06-16 05:57:55 Re: [HACKERS] UTF8 and KOI8 mini-howto