Search Postgresql Archives

NOT IN and NOT EXIST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Postgres optimizer automatically tries to convert an IN clause to Hash Join (something similar to EXISTS equivalent of that query).

Does a similar translation happen for NOT IN as well? Given that the column used is NOT NUL.

Select * from emp where deptid not in (select deptid from dept where deptLocation='New York');

Will this above statement be automatically converted to a plan which would match below statement?

Select * from emp where not exists (select 1 from dept where deptLocation='New York' and dept.deptid=emp.deptid);

Regards
Sameer

PS: Sent from my Mobile device. Pls ignore typo n abb


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux