Re: Query plan for NOT IN - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query plan for NOT IN
Date
Msg-id 7197.1254753036@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query plan for NOT IN  (Matthew Wakeling <matthew@flymine.org>)
List pgsql-performance
Matthew Wakeling <matthew@flymine.org> writes:
> Yes, that does work, but only because id is NOT NULL. I thought Postgres
> 8.4 had had a load of these join types unified to make it less important
> how the query is written?

NOT IN is not easily optimizable because of its odd behavior in the
presence of nulls.  Use NOT EXISTS instead, or that left join hack.

            regards, tom lane

pgsql-performance by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: Query plan for NOT IN
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: Best suiting OS