Re: NOT IN subquery optimization - Mailing list pgsql-hackers

From David Rowley
Subject Re: NOT IN subquery optimization
Date
Msg-id CAKJS1f_ZwXtzPz6wDpBXgAVYuxforsqpc6hBw05Y6aPGcOONfA@mail.gmail.com
Whole thread Raw
In response to Re: NOT IN subquery optimization  ("Li, Zheng" <zhelli@amazon.com>)
List pgsql-hackers
On Wed, 27 Feb 2019 at 13:41, Li, Zheng <zhelli@amazon.com> wrote:
> We still check for inner side's nullability, when it is nullable we
> append a "var is NULL" to the anti join condition. So every outer
> tuple is going to evaluate to true on the join condition when there
> is indeed a null entry in the inner.

That's possible, at least providing the var is NULL is an OR
condition, but the problem there is that you force the plan into a
nested loop join. That's unfortunately not going to perform very well
when the number of rows to process is large.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: "Li, Zheng"
Date:
Subject: Re: NOT IN subquery optimization
Next
From: Justin Pryzby
Date:
Subject: Re: Index INCLUDE vs. Bitmap Index Scan