Re: Convert IN sublink to join

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

 



<francisco.santos@xxxxxxxxxxxxxxxx> writes:
>       /*
>        * The sub-select must not refer to any Vars of the parent query.
>        * (Vars of higher levels should be okay, though.)
>        */
>       if (contain_vars_of_level((Node *) subselect, 1))
>               return NULL; 

> By commenting this code region I was able to optimize several correlated
> subqueries.

It's only pure luck that your test case still produces the right answer.
The IN code depends on the assumption that the sub-SELECT is independent
of the outer query.

			regards, tom lane


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux