Re: What happens between end of explain analyze and end of query execution ?

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: What happens between end of explain analyze and end of query execution ?
Дата
Msg-id 1365261991.56886.YahooMailNeo@web162905.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: What happens between end of explain analyze and end of query execution ?  (Franck Routier <franck.routier@axege.com>)
Список pgsql-performance
Franck Routier <franck.routier@axege.com> wrote:

> Ok, the problem definitely comes from the
> default_statistics_target which is obviously too high on the
> database.

> Now... can someone help me understand what happens ? Where can I
> look (in pg_stats ?) to see the source of the problem ? maybe a
> column with a huge list of different values the palnner has to
> parse ?

This is a fundamental issue in query planning -- how much work do
you want to do to try to come up with the best plan?  Too little,
and the plan can be unacceptably slow; too much and you spend more
extra time on planning than the improvement in the plan (if any)
saves you.  Reading and processing statistics gets more expensive
as you boost the volume.

What I would suggest is taking the default_statistics_target for
the cluster back down to the default, and selectviely boosting the
statistics target for individual columns as you find plans which
benefit.  Don't set it right at the edge of the tipping point, but
don't automatically jump to 5000 every time either.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Julien Cigar
Дата:
Сообщение: Re: slow joins?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: What happens between end of explain analyze and end of query execution ?