pgstattuple() should not be used on hash indexes - Mailing list pgsql-docs

From PG Doc comments form
Subject pgstattuple() should not be used on hash indexes
Date
Msg-id 161280049644.664.3414087059452030397@wrigleys.postgresql.org
Whole thread Raw
List pgsql-docs
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

pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small correction in chown command to set the owner of the pgsql data dir correctly
Next
From: PG Doc comments form
Date:
Subject: Documentation on Hash and btree Indexes on jsonb