Re: Allowing NOT IN to use ANTI joins - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Allowing NOT IN to use ANTI joins
Date
Msg-id CA+U5nMJbcsCf8b__z0iZmZm49ouHzqnU9qBGXq5QL88S8+VKog@mail.gmail.com
Whole thread Raw
In response to Re: Allowing NOT IN to use ANTI joins  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On 26 June 2014 10:31, David Rowley <dgrowleyml@gmail.com> wrote:

> If there's no way to tell that the target entry comes from a left join, then
> would it be a bit too quirky to just do the NOT NULL checking when
> list_length(query->rtable) == 1 ? or maybe even loop over query->rtable and
> abort if we find an outer join type? it seems a bit hackish, but perhaps it
> would please more people than it would surprise.

We don't know enough about joins at present, so we only allow it when
there are no joins (i.e. length == 1). That's just a statement of
reality, not a hack.

I would agree with Tom that the common usage is to do NOT IN against a
table with no where clause, so this would hit the most frequent use
case.

Maybe Tom will have a flash of insight before commit, or maybe we
figure out a way to extend it later.

Let's document it and move on.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [COMMITTERS] pgsql: Do all-visible handling in lazy_vacuum_page() outside its critic
Next
From:
Date:
Subject: Re: pg_receivexlog add synchronous mode