Database Index Size Estimator

Approximate B-tree index disk size from row count, key/include widths, page size, and fill factor.

Database Index Size Estimator

Estimate B-tree secondary index footprint from row count, key width, and page fill factor.

Heuristic for planning — engines differ (PostgreSQL, MySQL InnoDB, SQL Server). Variable-length keys, compression, and bloat from updates can raise real size significantly.

Leaf Math (Simplified)

Each leaf entry roughly stores: key + included columns + row pointer + per-row overhead.
Rows per page ≈ usable page bytes (page × fill factor) ÷ entry size.
Leaf size ≈ pages × page size, then add ~10–20% for internal B-tree levels.

What Inflates Indexes

  • Wide VARCHAR/UUID keys
  • Low fill factor after heavy updates/deletes (bloat)
  • Non-optimized types (store hashes instead of long strings when possible)
  • Too many overlapping secondary indexes

Use this for capacity planning; confirm with pg_relation_size, InnoDB stats, or vendor tooling on a realistic dataset.