pgstattuple returns a
relation's physical length, percentage of "dead" tuples, and other info. This may
help users to determine whether vacuum is necessary or
not. The argument is the target relation's name
(optionally schema-qualified). For example:

Note: The table_len will always be greater than
the sum of the tuple_len,
dead_tuple_len and
free_space. The difference
is accounted for by fixed page overhead, the per-page
table of pointers to tuples, and padding to ensure
that tuples are correctly aligned.

pgstattuple acquires
only a read lock on the relation. So the results do not
reflect an instantaneous snapshot; concurrent updates
will affect them.

pgstattuple judges a
tuple is "dead" if
HeapTupleSatisfiesNow
returns false.

pgstattuple(oid) returns
record

This is the same as pgstattuple(text), except that the
target relation is specified by OID.

pgstatindex(text) returns
record

pgstatindex returns a
record showing information about a B-tree index. For
example:

Submit correction

If you see anything in the documentation that is not correct, does not match
your experience with the particular feature or requires further clarification,
please use
this form
to report a documentation issue.