Re: Patch to support SEMI and ANTI join removal

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to support SEMI and ANTI join removal
Date: 2014-09-29 09:42:57
Message-ID: CAApHDvq9xsBq2nwrFB_9YME1989XJOBVk7KaqmYCLNNK_QGEuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 29, 2014 at 2:41 AM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:

> On 2014-09-28 17:32:21 +1300, David Rowley wrote:
> > My understanding of foreign keys is that any pending foreign key triggers
> > will be executed just before the query completes, so we should only ever
> > encounter pending foreign key triggers during planning when we're
> planning
> > a query that's being executed from somewhere like a volatile function or
> > trigger function, if the outer query has updated or deleted some records
> > which are referenced by a foreign key.
>
> Note that foreign key checks also can be deferred. So the window for
> these cases is actually larger.
>
>
Thanks Andres, I know you had said this before but I had previously failed
to realise exactly what you meant. I thought you were talking about
defining a foreign key to reference a column that has a deferrable unique
index. I now realise you were talking about making the foreign key itself
as deferrable. I've made a change to the patch locally to ignore foreign
keys that are marked as deferrable.

Regards

David Rowley

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-09-29 09:47:42 Re: Patch to support SEMI and ANTI join removal
Previous Message Andres Freund 2014-09-29 09:31:11 Re: Turning off HOT/Cleanup sometimes