Re: Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface - Mailing list pgsql-performance

From Michael Fuhr
Subject Re: Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface
Date
Msg-id 20050315233834.GA68209@winnie.fuhr.org
Whole thread Raw
In response to Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface  (David Gagnon <dgagnon@siunik.com>)
Responses Re: Performance problem on delete from for 10k rows. May
List pgsql-performance
On Tue, Mar 15, 2005 at 04:24:17PM -0500, David Gagnon wrote:

>  Il get this strange problem when deleting rows from a Java program.
> Sometime (For what I noticed it's not all the time) the server take
> almost forever to delete rows from table.

Do other tables have foreign key references to the table you're
deleting from?  If so, are there indexes on the foreign key columns?

Do you have triggers or rules on the table?

Have you queried pg_locks during the long-lasting deletes to see
if the deleting transaction is waiting for a lock on something?

> I rememeber having tried to delete the content of my table (IC) from
> PgAdminIII and I took couples of seconds!!! Not minutes.

How many records did you delete in this case?  If there are foreign
key references, how many records were in the referencing tables?
How repeatable is the disparity in delete time?  A single test case
might have been done under different conditions, so it might not
mean much.  No offense intended, but "I remember" doesn't carry as
much weight as a documented example.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Changing the random_page_cost default (was:
Next
From: David Brown
Date:
Subject: Re: cpu_tuple_cost