Re: DELETE SQL too slow.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Diogo Biazus <diogo(at)ikono(dot)com(dot)br>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: DELETE SQL too slow.
Date: 2002-09-03 15:37:54
Message-ID: 20020903083638.V46240-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 3 Sep 2002, Diogo Biazus wrote:

> I'm having problems with delete commands in postgres. They are too slow.
> I'm trying to delete a set o 300 rows in table with 50000 rows with a
> simple command like:
>
> DELETE FROM table WHERE field1 = '4'
>
> When I run the explain it tells me that index_scan is being used. But to
> complete the delete it takes more than 30 minutes and the CPU use never
> rise above 10%. The server that runs postgres is a RedHat Linux 7.3 over
> a Pentium III 900 Mhz with 512 MB RAM

Are you sure that there isn't a foreign key referencing this table?
That'll cascade out to at least a bunch of selects, and if you have
an on delete action, that'll change the other table(s) and possibly
then any table that references that one.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dario Fumagalli 2002-09-03 15:40:25 Re: Call closed: Almost happy ending (from "Data files became huge with no apparent reason" thread)
Previous Message dima 2002-09-03 15:29:22 Re: Two large files instead of one?