lost statistics; analyze needs to execute twice

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: pgsql-bugs(at)postgresql(dot)org
Subject: lost statistics; analyze needs to execute twice
Date: 2009-08-31 22:02:27
Message-ID: 3073cc9b0908311502y56998725n9954ec5db08054e1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

pgsql 8.3.7 and 8.4.0

when i issue an "immediate shutdown" the statistics on all tables disappear...
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

jd=# select relname, n_live_tup, n_dead_tup from pg_stat_user_tables
where relname = 'bpprovee';
relname | n_live_tup | n_dead_tup
----------+------------+------------
bpprovee | 111 | 0
(1 row)

jd=# select version();
version

----------------------------------------------------------------------------------------------------
PostgreSQL 8.4.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(Debian 4.3.2-1.1) 4.3.2, 64-bit
(1 row)

jd=# \q
postgres(at)casanova1:/usr/local/pgsql/8.4$ bin/pg_ctl -m immediate -D
$PWD/data stop
waiting for server to shut down.... done
server stopped
postgres(at)casanova1:/usr/local/pgsql/8.4$ bin/pg_ctl -D $PWD/data start
server starting
postgres(at)casanova1:/usr/local/pgsql/8.4$ bin/psql
psql (8.4.0)
Type "help" for help.

jd=# select relname, n_live_tup, n_dead_tup from pg_stat_user_tables
where relname = 'bpprovee';
relname | n_live_tup | n_dead_tup
----------+------------+------------
bpprovee | 0 | 0
(1 row)

jd=# analyze;
ANALYZE
jd=# select relname, n_live_tup, n_dead_tup from pg_stat_user_tables
where relname = 'bpprovee';
relname | n_live_tup | n_dead_tup
----------+------------+------------
bpprovee | 0 | 0
(1 row)

jd=# analyze;
ANALYZE
jd=# select relname, n_live_tup, n_dead_tup from pg_stat_user_tables
where relname = 'bpprovee';
relname | n_live_tup | n_dead_tup
----------+------------+------------
bpprovee | 111 | 0
(1 row)

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joseph Shraibman 2009-08-31 22:03:03 BUG #5023: pg_relation_size() is not case sensitive
Previous Message Pavel Stehule 2009-08-31 17:26:59 Re: inconsistent composite type null handling in plpgsql out variable