Обсуждение: pgstattuple() should not be used on hash indexes

Поиск
Список
Период
Сортировка

pgstattuple() should not be used on hash indexes

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/pgstattuple.html
Description:

pgstattuple works on some non-table relations, such as indexes. However it
does not work reliably on hash indexes. It works on some, but on others it
reports a scary warning: "index contains unexpected zero page at block,
Hint: Please REINDEX it."

The REINDEX works (makes it possible to use pgstattuple again), but as more
records are added to the index, the same error will eventually reoccur. The
problem is not with the index, but that pgstattuple doesn't support it
properly. You should use pgstathashindex instead.

See this post for more information:
https://www.postgresql.org/message-id/CAE9k0Pm8NWvPF2KCGVCpb6OivE%3DGdg-eQ_cLz7UMhxuDOq_1YQ%40mail.gmail.com