Re: [SQL] truncate vs. delete

2008-07-24 Thread Scott Marlowe
n Thu, Jul 24, 2008 at 7:53 AM, A. Kretschmer <[EMAIL PROTECTED]> 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 r

Re: [SQL] truncate vs. delete

2008-07-24 Thread Emi Lu
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 seque

Re: [SQL] truncate vs. delete

2008-07-24 Thread A. Kretschmer
am Thu, dem 24.07.2008, um 10:01:46 -0400 mailte Emi Lu folgendes: > 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-sta

Re: [SQL] truncate vs. delete

2008-07-24 Thread Emi Lu
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 Emi Lu wrote: Good morning, If I remember correctly, "delete" does not release space, while truncate will. I have an option now (1) Use object cre

Re: [SQL] truncate vs. delete

2008-07-24 Thread Lennin Caro
The truncate is more fast to delete, the truncate command not scan the table http://www.postgresql.org/docs/8.3/static/sql-truncate.html --- On Thu, 7/24/08, A. Kretschmer <[EMAIL PROTECTED]> wrote: > From: A. Kretschmer <[EMAIL PROTECTED]> > Subject: Re: [SQL] truncate vs.

Re: [SQL] truncate vs. delete

2008-07-24 Thread A. Kretschmer
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.

[SQL] truncate vs. delete

2008-07-24 Thread Emi Lu
Good morning, If I remember correctly, "delete" does not release space, while truncate will. I have an option now (1) Use object creator(with create/drop permission which I do not need in my cronjob script) to truncate table1(>100,000 recs) records (2) Use user1(has r/w only) to delete fro

Re: [SQL] truncate vs. delete

2008-07-24 Thread Emi Lu
A. Kretschmer wrote: am Thu, dem 24.07.2008, um 10:01:46 -0400 mailte Emi Lu folgendes: 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

Re: [SQL] truncate vs. delete

2008-07-24 Thread Shane Ambler
Emi Lu wrote: 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 key vacuum it (2) drop table (this table has no