pgstattuple
show tuple-level statistics
pgstattuple : show tuple-level statistics
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6970 | pgstattuple | pgstattuple | 1.5 |
STAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | pg_repack pg_squeeze pg_rewrite pg_dirtyread pg_column_tetris toastinfo pageinspect pagevis pg_freespacemap pg_buffercache |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
Create this extension with:
Usage
pgstattuple provides functions to obtain tuple-level statistics for tables and indexes, including dead tuple counts and free space metrics.
Table Statistics
Approximate (faster) version using visibility map and FSM:
B-Tree Index Statistics
GIN Index Statistics
Hash Index Statistics
Page Count
Access
Restricted to superusers and roles with pg_stat_scan_tables privileges.