Re: Pushing LIMIT into sub-queries of a UNION ALL?

Поиск
Список
Период
Сортировка
От Robert Klemme
Тема Re: Pushing LIMIT into sub-queries of a UNION ALL?
Дата
Msg-id BANLkTi=-dhJuyMLQU6SyS1YEa0co_3Bjxw@mail.gmail.com
обсуждение исходный текст
Ответ на Pushing LIMIT into sub-queries of a UNION ALL?  (Dave Johansen <davejohansen@gmail.com>)
Ответы Re: Pushing LIMIT into sub-queries of a UNION ALL?  (Dave Johansen <davejohansen@gmail.com>)
Список pgsql-performance
Dave,

how often do you want to repeat that posting?  What about instead
replying to the answers you got so far?

Cheers

robert


On Tue, May 17, 2011 at 5:31 PM, Dave Johansen <davejohansen@gmail.com> wrote:
> I am using Postgres 8.3 and I have an issue very closely related to the one
> described here:
> http://archives.postgresql.org/pgsql-general/2005-06/msg00488.php
>
> Basically, 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 sub-query version?
>
> Thanks,
> Dave



--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

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

Предыдущее
От: Aren Cambre
Дата:
Сообщение: Re: Postgres refusing to use >1 core
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: SORT performance - slow?