Re: on cascade delete performances, transaction and set constraints deferred - Mailing list pgsql-general

From Tom Lane
Subject Re: on cascade delete performances, transaction and set constraints deferred
Date
Msg-id 3107.1219086961@sss.pgh.pa.us
Whole thread Raw
In response to on cascade delete performances, transaction and set constraints deferred  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: on cascade delete performances, transaction and set constraints deferred  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> I'm not sure what's really happening but why apparently the delete
> statements get executed before the 2 inserts even if constraints are
> deferred?

You didn't mark the FK constraints as deferrable --- I'm pretty sure
the default is NOT DEFERRABLE.

> Why does it take so long?

Indexes on the FK columns would probably help.

            regards, tom lane

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: on cascade delete performances, transaction and set constraints deferred
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: on cascade delete performances, transaction and set constraints deferred