Re: Appending "LIMIT" to query drastically decreases performance

Поиск
Список
Период
Сортировка
От Matthew
Тема Re: Appending "LIMIT" to query drastically decreases performance
Дата
Msg-id Pine.LNX.4.58.0711301327520.3731@aragorn.flymine.org
обсуждение исходный текст
Ответ на Appending "LIMIT" to query drastically decreases performance  (cluster <skrald@amossen.dk>)
Ответы Re: Appending "LIMIT" to query drastically decreases performance  (Bill Moran <wmoran@collaborativefusion.com>)
Список pgsql-performance
On Fri, 30 Nov 2007, cluster wrote:
> Can anyone explain the following odd behavior?
> I have a query that completes in about 90 ms. If I append LIMIT to the
> very end, eg. "LIMIT 500" the evaluation time increases to about 800 ms.
> How can performance get *worse* by giving the database the option to
> stop the evaluation earlier (when it reaches the output 500 rows)?

The planner doesn't always get it right. Simple.

Have you done a "VACUUM FULL ANALYSE" recently?

Matthew

--
It is better to keep your mouth closed and let people think you are a fool
than to open it and remove all doubt.                  -- Mark Twain

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

Предыдущее
От: cluster
Дата:
Сообщение: Appending "LIMIT" to query drastically decreases performance
Следующее
От: Matthew
Дата:
Сообщение: Re: GiST indexing tuples