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  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Tue, Sep 1, 2009 at 00:02, Jaime
Casanova<jcasanov@systemguards.com.ec> 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
Дата:
Сообщение: Re: psql: FATAL: the database system is in recovery mode
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #5025: Aggregate function with subquery in 8.3 and 8.4.