Re: Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface
Дата
Msg-id 20050315233834.GA68209@winnie.fuhr.org
обсуждение исходный текст
Ответ на Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface  (David Gagnon <dgagnon@siunik.com>)
Ответы Re: Performance problem on delete from for 10k rows. May  (David Gagnon <dgagnon@siunik.com>)
Список 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 по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Changing the random_page_cost default (was:
Следующее
От: David Brown
Дата:
Сообщение: Re: cpu_tuple_cost