Re: Allowing NOT IN to use ANTI joins

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Jeevan Chalke <jeevan.chalke@enterprisedb.com>, Simon Riggs <simon@2ndquadrant.com>, Marti Raudsepp <marti@juffo.org>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2014-07-11T15:04:06Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Fri, Jul 11, 2014 at 1:11 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Hm ... actually, there might be a better answer: what about transforming
>> WHERE (x,y) NOT IN (SELECT provably-not-null-values FROM ...)
>> to
>> WHERE <antijoin condition> AND x IS NOT NULL AND y IS NOT NULL

> I think this is the way to go.

> I'll try and get some time soon to look into adding the IS NOT NULL quals,
> unless you were thinking of looking again?

Go for it, I've got a lot of other stuff on my plate.

			regards, tom lane