Re: postmaster hangs on delete from - Mailing list pgsql-general

From Alan Hodgson
Subject Re: postmaster hangs on delete from
Date
Msg-id 200903130853.47652@hal.medialogik.com
Whole thread Raw
In response to postmaster hangs on delete from  (emsa@devdep.com)
List pgsql-general
On Friday 13 March 2009, emsa@devdep.com wrote:
> Hi,
>
> I have a serious issue with delete from.
>
> When I do something like:
>
> "delete from CALC_INVOICE_DATA where PERIOD_END>='2011-01-01'"
>
> the postmaster takes 100% CPU and then nothing happens.
>

Some possibilities:

1) If it's using 100% CPU for a long period of time, you might have a
foreign key relationship to this table, and the key in the other (largish,
but not larger than RAM) table is not indexed, which is resulting in a seq
scan in cache for every row being deleted.

2) You have another on delete trigger that is expensive to run.

3) Some other backend is really using the 100% CPU and your delete is just
waiting for a lock on the table and not doing anything.

--
Even a sixth-grader can figure out that you can’t borrow money to pay off
your debt

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Inserting string with a " into an array using {} syntax ... possible?
Next
From: Tom Lane
Date:
Subject: Re: Maximum transaction rate