Re: reltuples after vacuum and analyze

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: reltuples after vacuum and analyze
Дата
Msg-id 27553.1106612786@sss.pgh.pa.us
обсуждение исходный текст
Ответ на reltuples after vacuum and analyze  (Litao Wu <litaowu@yahoo.com>)
Ответы Re: reltuples after vacuum and analyze
Список pgsql-performance
Litao Wu <litaowu@yahoo.com> writes:
> I noticed that reltuples are way off if
> I vacuum the table and analyze the table.
> And the data (296901) after vacuum seems
> accurate while
> the reltuples (1.90744e+06)
> after anlayze is too wrong.

VACUUM derives an exact count because it scans the whole table.  ANALYZE
samples just a subset of the table and extrapolates.  It would appear
that you've got radically different tuple densities in different parts
of the table, and that's confusing ANALYZE.

> My PG version is 7.3.2 (I know it is old).

8.0's ANALYZE uses a new sampling method that we think is less prone
to this error, though of course any sampling method will fail some of
the time.

            regards, tom lane

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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: PgPool changes WAS: PostgreSQL clustering VS MySQL
Следующее
От: "SpaceBallOne"
Дата:
Сообщение: Re: poor performance of db?