PostgreSQL storage

Identify whether tables, indexes, TOAST, or WAL are driving growth without reclaiming space in production.

Last updated

On this page (5)

PostgreSQL ยท Storage

Before you start

  • Read access to size and monitoring views and to filesystem or volume metrics.

Procedure

  1. Trend database and tablespace sizes and sample the largest relations using pg_total_relation_size, pg_table_size, and pg_indexes_size; account for partitions separately.
  2. Compare relation growth with data-volume and WAL-volume usage. Inspect archiving and replication state if WAL is growing.
  3. Record the headroom and likely cause; avoid deleting WAL files or starting rewrites as part of diagnosis.

Verify the result

  • Repeat the sample across a representative workload interval and reconcile major differences between SQL sizes and host usage.
  • Confirm that any WAL backlog explanation matches observed archive or replication status before proposing changes.

Official documentation

Have Pilae operate PostgreSQL

We agree what to monitor, how to recover and who responds when something breaks. Bring your existing deployment or start with a new one.