InfyCalculator
💻

Database Index Size Calculator

Estimate the on-disk size of a B-tree index from row count, the width of the indexed columns and per-entry overhead — before you add it and watch storage grow.

Number of rows
Indexed column width
Per-entry overhead
Index fill factor
Loading calculator…

How it works

Bytes per entry = key width + overhead · Index size = rows × bytes/entry ÷ fill factor

A B-tree index stores one entry per row: the indexed key value plus a pointer back to the row and some bookkeeping. Multiply rows by that per-entry size to get the raw data, then divide by the fill factor because engines deliberately leave pages partly empty so future inserts do not force expensive page splits. The estimate ignores the small upper tree levels, which add only a few percent, so it is a good planning figure. The practical lesson is that wide keys and many indexes multiply storage fast — each extra index is a full copy of its key column across every row.

Worked example

Ten million rows indexed on a 16-byte key with 12 bytes of overhead is 28 bytes each, or 280 MB packed. At a 70% fill factor that becomes 280 ÷ 0.70 = 400 MB on disk for that one index.

Frequently asked questions

Why divide by the fill factor?

Databases leave free space in each index page so that inserts and updates can slot in without splitting the page, which is costly. A 70% fill factor means pages are about 70% full, so the on-disk footprint is the packed size divided by 0.70 — roughly 43% larger than the raw data.

Does every index cost this much?

Each additional index stores its own copy of the indexed columns for every row, so five indexes on a big table can dwarf the table itself. Composite indexes on several wide columns are the most expensive. This is why removing unused indexes is a real storage and write-speed win.

Is this the same for all databases?

The B-tree model and the key + pointer + overhead structure are broadly similar across PostgreSQL, MySQL/InnoDB and SQL Server, but the exact per-entry overhead and page layout differ. Treat this as a planning estimate and confirm against your engine’s actual index size once built.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.