Database Index Size Estimator
Estimates what each index on a table costs on disk, and how deep its tree gets.
Loading the tool…
How to use this tool
- Paste the CREATE TABLE, including the PRIMARY KEY, UNIQUE and REFERENCES clauses — those are what the tool turns into indexes.
- Pick the engine and set the row count.
- Select Estimate the indexes.
- Compare the entry width column across the indexes — that single number explains most of the size difference between them.
- Treat the totals as an order of magnitude, not a measurement: real fragmentation and real value distribution are not knowable from DDL.
What index size estimator does
Indexes are usually discussed as though they were free, and then somebody notices that the indexes on a table are larger than the table. A b-tree leaf entry is the key plus a pointer to the row plus a few bytes of per-entry overhead, and on InnoDB and on any clustered table the pointer is the whole primary key — so a wide primary key quietly makes every secondary index on that table wider too. Above the leaves sit the internal levels, and every extra level is another page read on a cold lookup.
This page reads the primary key, unique constraints and foreign key references out of your CREATE TABLE and estimates each resulting index: the key width, the full entry width including the row locator, how many entries fit on a page at your fill factor, how many levels the tree ends up with, and the total size. It is an estimate and it is labelled as one — nothing here can know your real value distribution or how much the pages have fragmented. What it is good for is comparing: a 130-byte email index against an 8-byte integer one, before either exists.