Skip to content

Largest tables#

What it does

Selects user tables by estimated heap pages, then reports their total relation sizes.

$ pgcue run storage.largest_tables

Use when

  • A database is consuming more storage than expected.
  • Identifying where table and index storage is concentrated.

Inspect

  • Tables with unusually large total or index sizes.
  • Large tables that also accumulate dead tuples.

Result

Point-in-time measurement at execution time.

Columns#

Column Meaning
schema_name Schema containing the table.
table_name Table represented by the row.
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
--limit integer, minimum 1, accepts NULL 20 Maximum number of tables to show. Use NULL for no limit.

Compatibility#

  • PostgreSQL 14+