🇪🇸 Cambiar a versión en español: Calculadora de Tamaño de Base de Datos SQL, Índices y Disco
Calculate the true physical disk footprint of PostgreSQL or MySQL tables before hitting out-of-disk outages: models MVCC tuple headers, page fillfactor, secondary B-Tree indexes, update/delete bloat, WAL/temp headroom, and monthly cloud SSD cost.
Disk Layer Breakdown & Backup Provisioning
| Storage Layer | Estimated Footprint | Share of Provisioned Disk | Monthly Cloud SSD Cost |
|---|
Physical Heap, B-Tree & Bloat Math Formula
•
Heap Size = Rows × (Payload + 24B Tuple Header + 4B Line Pointer) / 0.90 effective page fill•
B-Tree Size = Rows × Indexes × (KeyBytes + 16B TID/Header) / 0.70 (70% steady-state B-Tree fill)•
Provisioned Disk = (Heap × (1 + Bloat%) + B-Tree × (1 + 0.85×Bloat%)) × (1 + WAL%)
SQL Storage Sizing Frequently Asked Questions
Why does 26 GB of raw row data consume nearly 70 GB inside PostgreSQL?
Every tuple pays a 24-byte MVCC header plus 8-byte alignment padding, B-Tree leaf pages stabilize near ~70% density after random splits, updates leave dead tuples until VACUUM reclaims pages, and databases require WAL + temp sort headroom.
How do you shrink runaway B-Tree index amplification without losing query speed?
Drop unused duplicate composite indexes via pg_stat_user_indexes, use partial indexes (WHERE archived = false), and replace B-Trees on append-only timestamps with lightweight BRIN indexes (often 90%+ smaller).
Official Technical Docs: PostgreSQL Database Page Layout · PostgreSQL Disk Usage Guide · B-tree Architecture.
100% client-side computation; estimates exclude external TOAST blobs and underlying ZFS/filesystem compression.