Pushing LIMIT into sub-queries of a UNION ALL?

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

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

Предыдущее
От: Andrey Vorobiev
Дата:
Сообщение: Performance degradation of inserts when database size grows
Следующее
От: STA
Дата:
Сообщение: Re: Modifying shared_buffers causes despite plenty of ram