Table size#
What it does
Shows the table, index, and total size of a PostgreSQL table.
Use when
- Investigating the storage footprint of a known table.
- Comparing table data size with its index size.
Inspect
- Index storage that is unexpectedly large relative to table data.
- Size changes between observations.
Result
Point-in-time measurement at execution time.
Columns#
| Column | Meaning |
|---|---|
indexes_size |
Human-readable combined size of the table's indexes. |
schema_name |
Schema containing the table. |
table_name |
Table represented by the row. |
table_size |
Human-readable size of the table's main fork. |
total_bytes |
Total table, index, and TOAST size in bytes. |
total_size |
Human-readable total table, index, and TOAST size. |
Parameters#
| Option | Type | Default | Description |
|---|---|---|---|
--schema |
string, required | None | Schema containing the table. |
--table |
string, required | None | Table name. |
Compatibility#
- PostgreSQL 14+
Related checks#
- Largest tables
storage.largest_tables