Delete operation VERY slow... - Mailing list pgsql-performance

From David Leangen
Subject Delete operation VERY slow...
Date
Msg-id 1150441126.4812.23.camel@sonoda.bioscene.co.jp
Whole thread Raw
Responses Re: Delete operation VERY slow...  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: Delete operation VERY slow...  ("Gourish Singbal" <gourish@gmail.com>)
List pgsql-performance
Hello!

I am trying to delete an entire table. There are about 41,000 rows in
the table (based on count(*)).

I am using the SQL comment: delete from table;

The operation seems to take in the order of hours, rather than seconds
or minutes.

"Explain delete from table" gives me:

                           QUERY PLAN
----------------------------------------------------------------
 Seq Scan on table  (cost=0.00..3967.74 rows=115374 width=6)
(1 row)


I am using an Intel Pentium D 2.8GHz CPU. My system has about 1.2GB of
RAM. This should be ok... my database isn't that big, I think.


Any ideas why this takes so long and how I could speed this up?

Or alternatively, is there a better way to delete all the contents from
a table?


Thank you!



pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Performance of pg_dump on PGSQL 8.0
Next
From: "A. Kretschmer"
Date:
Subject: Re: Delete operation VERY slow...