Re: truncate vs. delete - Mailing list pgsql-sql

From Emi Lu
Subject Re: truncate vs. delete
Date
Msg-id 48888B4A.1090301@encs.concordia.ca
Whole thread Raw
In response to Re: truncate vs. delete  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: truncate vs. delete
Re: truncate vs. delete
List pgsql-sql
A. Kretschmer wrote:
> am  Thu, dem 24.07.2008, um  9:47:48 -0400 mailte Emi Lu folgendes:
>> I found a link for SQL Server, it applies to PostgreSQL 8.0.x as well?
>> http://vadivel.blogspot.com/2004/06/delete-vs-truncate-statement.html
> 
> Not realy, for instance, pg can rollback a truncate, and a sequence are
> not reset.
> 
> 
Thank you. I am quite sure that I will not use "delete" now.
Now I a question about how efficient between

(1) truncate a big table (with 200, 000)    vacuum it (optional?)    drop primary key    load new data    load primary
ke   vacuum it
 

(2) drop table (this table has no trigger, no foreign key)    re-create table (without primary key)    load new data
setupprimary key    vacuum it
 

suggestions PLEASE?

Thanks a lot!



pgsql-sql by date:

Previous
From: Lennin Caro
Date:
Subject: Re: truncate vs. delete
Next
From: "A. Kretschmer"
Date:
Subject: Re: truncate vs. delete