Re: lost statistics; analyze needs to execute twice

Поиск
Список
Период
Сортировка
Искать
От
Magnus Hagander
Тема
Re: lost statistics; analyze needs to execute twice
Дата
Msg-id
9837222c0909010109m49aced7sf88622f070829476@mail.gmail.com
Ответ на
Список
Дерево обсуждения
lost statistics; analyze needs to execute twice Jaime Casanova <jcasanov@systemguards.com.ec>
Re: lost statistics; analyze needs to execute twice Magnus Hagander <magnus@hagander.net>
Re: lost statistics; analyze needs to execute twice Tom Lane <tgl@sss.pgh.pa.us>
Re: lost statistics; analyze needs to execute twice Alvaro Herrera <alvherre@commandprompt.com>
Re: lost statistics; analyze needs to execute twice Tom Lane <tgl@sss.pgh.pa.us>
Re: lost statistics; analyze needs to execute twice Magnus Hagander <magnus@hagander.net>
On Tue, Sep 1, 2009 at 00:02, Jaime
Casanova wrote:
> Hi,
>
> pgsql 8.3.7 and 8.4.0
>
> when i issue an "immediate shutdown" the statistics on all tables disappear...

That is by design. Whenever the server goes into crash recovery on
startup, it will clean out the statistics. Since the statistics data
is not kept crashsafe, there is no way to know if it's corrupt or not.


> and when i try to recover them via an analyze; (on all tables on the
> database) the result is nothing...
> i have to exexute the analyze commands twice to compute the statistics

pg_stat_* are not directly affected by ANALYZE. They collect runtime
statistics about activity in the tables, ANALYZE collects statistics
about what's *in* the tables (primarily stored in pg_statistics, not
pg_stat_*).


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/
В списке pgsql-bugs по дате отправления
От: Guillaume Smet
Дата:
От: Heikki Linnakangas
Дата:
FAQ