Re: simple query with radically different plan after 9.0 -> 9.2 upgrade

Поиск
Список
Период
Сортировка
От Kevin Goess
Тема Re: simple query with radically different plan after 9.0 -> 9.2 upgrade
Дата
Msg-id CABZkbxhpTQcZ7HAiccnFC4F-0gvCW9yOJEgWYApzE_M1uSYyGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: simple query with radically different plan after 9.0 -> 9.2 upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Tue, Nov 12, 2013 at 2:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> That's right, we store 90 days and roll up data older than that into a
> different table.

Ah-hah.  The default statistics target is 100, so indeed ANALYZE is going
to be able to fit every date entry in the table into the
most-common-values list.  In this situation, you'd rather that there were
some uncertainty left.  Given that the distribution of the date column is
(I assume) pretty level, you don't really need full information about this
column.  I'd try backing off the stats target for the date column (and
only the date column --- see ALTER TABLE SET STATISTICS) to 50 or even
less.

That was it!  I set it to 50 on all the 90-days tables and now we no longer see that regular increase in disk reads between midnight of the new day and the 1:37am re-analyze. 

Thanks!



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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Partitioning and triggers
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Partitioning and triggers