Re: NOT IN subquery optimization

From: Richard Guo <riguo(at)pivotal(dot)io>
To: "Li, Zheng" <zhelli(at)amazon(dot)com>
Cc: "Finnerty, Jim" <jfinnert(at)amazon(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NOT IN subquery optimization
Date: 2019-03-01 02:27:04
Message-ID: CAN_9JTweDc4uu2dDGB4tngoUc9Ouc7xOyGpd+s_Bz+5dAmprQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 26, 2019 at 6:51 AM Li, Zheng <zhelli(at)amazon(dot)com> wrote:

> Resend the patch with a whitespace removed so that "git apply patch" works
> directly.
>
>

Hi Zheng,

I have reviewed your patch. Good job except two issues I can find:

1. The patch would give wrong results when the inner side is empty. In this
case, the whole data from outer side should be in the outputs. But with the
patch, we will lose the NULLs from outer side.

2. Because of the new added predicate 'OR (var is NULL)', we cannot use hash
join or merge join to do the ANTI JOIN. Nested loop becomes the only
choice,
which is low-efficency.

Thanks
Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-03-01 02:33:38 Tighten error control for OpenTransientFile/CloseTransientFile
Previous Message Nikita Glukhov 2019-03-01 02:24:39 Fix memleaks and error handling in jsonb_plpython