Re: Convert IN sublink to join

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Convert IN sublink to join
Дата
Msg-id 19522.1134574013@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Convert IN sublink to join  (<francisco.santos@tagus.ist.utl.pt>)
Список pgsql-performance
<francisco.santos@tagus.ist.utl.pt> 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

В списке pgsql-performance по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Convert IN sublink to join
Следующее
От: Andrew Rawnsley
Дата:
Сообщение: Re: SAN/NAS options