Re: on cascade delete performances, transaction and set constraints deferred

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: on cascade delete performances, transaction and set constraints deferred
Date: 2008-08-18 19:16:01
Message-ID: 3107.1219086961@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Sergio Borgonovo <mail(at)webthatworks(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2008-08-18 19:51:39 Re: on cascade delete performances, transaction and set constraints deferred
Previous Message Ivan Sergio Borgonovo 2008-08-18 19:08:37 on cascade delete performances, transaction and set constraints deferred