Re: Trouble managing planner for timestamptz columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trouble managing planner for timestamptz columns
Дата
Msg-id 7329.1142015473@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Trouble managing planner for timestamptz columns  ("Marc Morin" <marc@sandvine.com>)
Список pgsql-performance
"Marc Morin" <marc@sandvine.com> writes:
> We tend to analyze these tables every day or so and this doesn't always
> prove to be sufficient....

Seems to me you just stated your problem.  Instead of having the planner
make wild extrapolations, why not set up a cron job to analyze these
tables more often?  Or use autovacuum which will do it for you.

> Since the table is so large and the system is busy (disk not idle at
> all), doing an analyze on this table in the production system can take
> 1/2 hour!  (statistics collector set to 100).

I'd believe that for vacuum analyze, but analyze alone should be cheap.
Have you perhaps got some weird datatypes in the table?  Maybe you
should back off the stats target a bit?

We do support analyzing selected columns, so you might try something
like a cron job analyzing only the timestamp column, with a suitably low
stats target for that column.  This would yield numbers far more
reliable than any extrapolation the planner could do.

            regards, tom lane

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

Предыдущее
От: "Marc Morin"
Дата:
Сообщение: Trouble managing planner for timestamptz columns
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Hanging queries on dual CPU windows