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

From David Rowley
Subject Re: Allowing NOT IN to use ANTI joins
Date
Msg-id CAApHDvqE55qra8vfDvJ_0Gnw7152QM95YH1XD1enOE=T1bgFRQ@mail.gmail.com
Whole thread Raw
In response to Re: Allowing NOT IN to use ANTI joins  (Jeevan Chalke <jeevan.chalke@enterprisedb.com>)
List pgsql-hackers
On Wed, Jul 2, 2014 at 9:25 PM, Jeevan Chalke <jeevan.chalke@enterprisedb.com> wrote:


Testing more on SQL level.



I'm just looking into an issue I've found in the find_inner_rels() function, where it does not properly find the rel in the from list in certain cases, for example:

explain select * from a where id not in (select b.id from b left outer join c on b.id=c.id);
 
fails to use an ANTI JOIN, but if you remove the left join to c, it works perfectly.

Currently I'm just getting my head around how the jointree is structured and reading over deconstruct_jointree to see how it handles this. I may change the function to find_outer_rels and just look for outer joins in the function.

However, assigning it to author to think on above cosmetic issues.


Thanks for the review. I'll fix the issues you listed soon, but I'll likely delay posting the updated patch until I have the other fix in place.

Regards

David Rowley

Thanks

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Aggregate function API versus grouping sets
Next
From: Dilip kumar
Date:
Subject: Re: Selectivity estimation for inet operators