Re: Slow queries after vacuum analyze

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Slow queries after vacuum analyze
Дата
Msg-id 20121221153413.144660@gmx.com
обсуждение исходный текст
Ответ на Slow queries after vacuum analyze  (Ghislain ROUVIGNAC <ghr@sylob.com>)
Список pgsql-performance
Ghislain ROUVIGNAC wrote:

>> I would leave default_statistics_target alone unless you see a lot of
>> estimates which are off by more than an order of magnitude. Even then, it
>> is often better to set a higher value for a few individual columns than for
>> everything.
>
>
> We had an issue with a customer where we had to increase the statistics
> parameter for a primary key.
> So I'd like to know if there is a way to identify for which column we have
> to change the statistics.

I don't know a better way than to investigate queries which seem to
be running longer than you would expect, and look for cases where
EXPLAIN ANALYZE shows an estimated row count which is off from
actual by enough to cause a problem. Sometimes this is caused by
correlations between values in different columns, in which case a
higher target is not likely to help; but sometimes it's a matter
that there is an uneven distribution among values not included in
the "most common values", in which case boosting the target to
store more values and finer-grained information on ranges will be
exactly what you need.

-Kevin


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

Предыдущее
От: Charles Gomes
Дата:
Сообщение: Re: Performance on Bulk Insert to Partitioned Table
Следующее
От: Richard Neill
Дата:
Сообщение: Re: Why does the query planner use two full indexes, when a dedicated partial index exists?