Re: Pushing IN (subquery) down through UNION ALL?

Поиск
Список
Период
Сортировка
От Dave Johansen
Тема Re: Pushing IN (subquery) down through UNION ALL?
Дата
Msg-id AANLkTi=Q2a39ACqezdk1crnkYU47=ewXicGjXbXt1Eu0@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Pushing IN (subquery) down through UNION ALL?  (Vik Reykja <vikreykja@gmail.com>)
Ответы Re: Pushing IN (subquery) down through UNION ALL?
Список pgsql-performance
On Thu, Feb 24, 2011 at 12:33 PM, Vik Reykja <vikreykja@gmail.com> wrote:
On Thu, Feb 24, 2011 at 16:14, Dave Johansen <davejohansen@gmail.com> wrote:
You'll notice that the subquery version is doing the full join and then the filtering, but the explicitly listed version pushing the filtering into the plan before the join. Is there a way to make the subquery version perform the same optimization?

EXPLAIN ANALYZE SELECT * FROM addressesall WHERE id = ANY (array(SELECT id FROM users WHERE name='A'));

(Tested on 9.0.3)

I just tested that on 8.3.3 and it performed quickly like I expected the other query to, so that did the trick.
Thanks a ton,
Dave

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

Предыдущее
От: Dave Crooke
Дата:
Сообщение: Picking out the most recent row using a time stamp column
Следующее
От: Vik Reykja
Дата:
Сообщение: Re: Pushing IN (subquery) down through UNION ALL?