Re: Query performance

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема Re: Query performance
Дата
Msg-id ed80d$447a1c8c$506d0da5$19172@news.chello.at
обсуждение исходный текст
Ответ на Query performance  ("Lou O'Quin" <loquin@talleyds.com>)
Список pgsql-performance
Antonio Batovanja wrote:
> Laurenz Albe wrote:
>
>> Antonio Batovanja wrote:
>>> I'm having trouble understanding, why a specific query on a small
>>> database is taking so long...
>>>
>> Before I try to understand the execution plans:
>>
>> Have you run ANALYZE on the tables involved before you ran the query?
>
> Hi,
>
> Just to be on the safe side, I've run ANALYZE now.
> Here are the query plans for the two queries:

I suspect a misunderstanding here. What Laurenz probably meant is to run
  analyze on the involved _tables_ so the statistics data is refreshed.
If the query planner runs with outdated statistics, queries may perform
very poorly. Try

    vacuum full analyze yourdatabase

To fully vacuum your database and analyze all tables.
(vacuum full is extra, but can't hurt.)

http://www.postgresql.org/docs/8.1/static/sql-vacuum.html
http://www.postgresql.org/docs/8.1/static/sql-analyze.html

Regards, Erwin

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

Предыдущее
От: Erwin Brandstetter
Дата:
Сообщение: Re: Query performance
Следующее
От: Anthony Ransley
Дата:
Сообщение: Split select completes, single select doesn't and becomes IO bound!