LIMIT and UNION ALL

Поиск
Список
Период
Сортировка
От Dave Johansen
Тема LIMIT and UNION ALL
Дата
Msg-id BANLkTikw+DqY+8S+5icmzfbnAE9-13pZGQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: LIMIT and UNION ALL  (Robert Klemme <shortcutter@googlemail.com>)
Re: LIMIT and UNION ALL  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-performance
I am using Postgres 8.3.3 and I have a VIEW which is a UNION ALL of two tables but when I do a select on the view using a LIMIT, it scans the entire tables and takes significantly longer than writing out the query with the LIMITs in the sub-queries themselves. Is there a solution to get the view to perform like the query with the LIMIT explicitly placed in the sub-queries?

I noticed a similar question in this post http://archives.postgresql.org/pgsql-general/2005-06/msg00488.php but I wasn't able to find an answer.

Thanks,
Dave

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

Предыдущее
От: Dave Johansen
Дата:
Сообщение: Re: hash semi join caused by "IN (select ...)"
Следующее
От: Robert Klemme
Дата:
Сообщение: Re: LIMIT and UNION ALL