Very slow delete.

From: Brock Henry <brock(dot)henry(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Very slow delete.
Date: 2004-10-12 02:10:49
Message-ID: 97b3fe2041011191037230ef7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a table with 29268 odd records. Deleting records is VERY slow,
and I don't know why.

I explained analysed the following query:
delete from people where id < '2000'

Index Scan using people_pkey on people (cost=0.00..71.68 rows=2792
width=6) (actual time=1.361..5.657 rows=2000 loops=1)
Index Cond: (id < 3000)
Total runtime: 13.006 ms
3 row(s)
Total runtime: 63,869.322 ms

using phppgadmin (it's also slow via command line or Perl/DBD).

I haven't optimized postgresql yet (kernel.shmmax, etc), but I don't
see why it is taking this long. Why is it 13ms, and then 63869ms?

There is 1 fkey relationship, and it is primary key to a few other
(now empty) tables.

The fkey's are on update cascade on delete restrict. Deletes on other
tables are quick.

Any ideas?

Thanks

Brock

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-12 03:38:49 Re: Very slow delete.
Previous Message William Diaz Pabón 2004-10-12 01:55:27 Reiniciar secuencias