Re: on delete cascade slowing down delete - Mailing list pgsql-general

From David Fetter
Subject Re: on delete cascade slowing down delete
Date
Msg-id 20080821180247.GF16379@fetter.org
Whole thread Raw
In response to on delete cascade slowing down delete  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
On Thu, Aug 21, 2008 at 07:06:32PM +0200, Ivan Sergio Borgonovo wrote:
> I've a large table with a pk and several smaller tables with fk
> referencing to it.
>
> deleting from the first table is very slow.
>
> Not all the related fk have indexes but they are VERY small (0 to
> 100 records) while the main table contain 600-800K records.
>
> the
> explain delete p;
> doesn't give any clue.
>
> Any hint to track down the problem?

BEGIN;
EXPLAIN ANALYZE DELETE ...
ROLLBACK;

Lack of indexes on the referencing tables might be an issue, as might
any triggers.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

pgsql-general by date:

Previous
From: Joshua Drake
Date:
Subject: Re: on delete cascade slowing down delete
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: on delete cascade slowing down delete