lost statistics; analyze needs to execute twice - Mailing list pgsql-bugs

From Jaime Casanova
Subject lost statistics; analyze needs to execute twice
Date
Msg-id 3073cc9b0908311502y56998725n9954ec5db08054e1@mail.gmail.com
Whole thread Raw
Responses Re: lost statistics; analyze needs to execute twice  (Magnus Hagander <magnus@hagander.net>)
List 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=3D# select relname, n_live_tup, n_dead_tup from pg_stat_user_tables
where relname =3D 'bpprovee';
 relname  | n_live_tup | n_dead_tup
----------+------------+------------
 bpprovee |        111 |          0
(1 row)

jd=3D# 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=3D# \q
postgres@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@casanova1:/usr/local/pgsql/8.4$ bin/pg_ctl -D $PWD/data start
server starting
postgres@casanova1:/usr/local/pgsql/8.4$ bin/psql
psql (8.4.0)
Type "help" for help.

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

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

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


--=20
Atentamente,
Jaime Casanova
Soporte y capacitaci=C3=B3n de PostgreSQL
Asesor=C3=ADa y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: inconsistent composite type null handling in plpgsql out variable
Next
From: "Joseph Shraibman"
Date:
Subject: BUG #5023: pg_relation_size() is not case sensitive