Re: Strange delete behaviour - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Strange delete behaviour
Date
Msg-id 20050801125543.GA51284@winnie.fuhr.org
Whole thread Raw
In response to Strange delete behaviour  (Renzo Kottmann <renzo@tzi.de>)
Responses Re: Strange delete behaviour  ("Renzo Kottmann" <renzo@tzi.de>)
List pgsql-general
On Mon, Aug 01, 2005 at 01:57:32PM +0200, Renzo Kottmann wrote:
> If I try a
>
> delete
>      from   t_node
>      where  node_doc_id = XX;
>
> from inside a plpgsql function
> ...
> The deletion does not finish after several minutes and the CPU is
> running at 100% all the time unless I stop postmaster. A select works
> normal and gives me around 2500 rows. Does anybody has an idea why this
> happens?

What happens if you execute the delete by itself, i.e., not from
inside a function?  What output do you get if you connect to the
database with psql and execute "EXPLAIN ANALYZE DELETE ..."?

Do other tables have foreign key references to t_node?  If so, are
there indexes on those tables' foreign key columns?  How many records
are in t_node and any tables that reference it?  Do you keep the
tables vacuumed and analyzed?

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

pgsql-general by date:

Previous
From: Gnanavel S
Date:
Subject: Re: Strange delete behaviour
Next
From: John DeSoi
Date:
Subject: Re: Alter privileges for all tables