Re: ANALYZE not working?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ANALYZE not working?
Дата
Msg-id 3064.1041887771@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ANALYZE not working?  (Jeff Boes <jboes@nexcerpt.com>)
Список pgsql-admin
Jeff Boes <jboes@nexcerpt.com> writes:
> This is just way too weird:
> $ psql
> # select count(*) from stat_fetch;
>  count
> --------
>  143243
> (1 row)

> (Big table, two indexes.)

> # analyze stat_fetch;
> ANALYZE

> (That should update all the stats, right?)

> # select relname, reltuples from pg_class
> # where relname = 'stat_fetch';
>   relname   | reltuples
> ------------+-----------
>  stat_fetch |      3419
> (1 row)

> (Wha? Huh?)

Have you done VACUUM FULL on this table in living memory?

The current implementation of ANALYZE can get fooled if the table has
very nonuniform tuple density (eg, lots of empty or near-empty pages
near the beginning, and filled pages near the end).

I'd try "vacuum full verbose stat_fetch" and note whether it shrinks the
table a lot.  (If it does, that suggests that you need more frequent
regular vacuums, and/or larger FSM settings in postgresql.conf.)

            regards, tom lane

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

Предыдущее
От: Ron Mayer
Дата:
Сообщение: Re: ANALYZE not working?
Следующее
От: mitchell laks
Дата:
Сообщение: repair table? database? how ? neccessary?