SQL and test data
How much storage will a million database rows need?
Tools to use
A forecast of one million records is not enough to size a disk: short IDs and long text rows occupy different space, before indexes and metadata. Database Size Estimate makes assumptions explicit. Its precise-looking decimals describe arithmetic, not measurements of a real database.
Start with a 200-byte row assumption
rows = 1000000
averageRowBytes = 200
indexFactor = 0.3
overheadFactor = 0.15
replicas = 1
base = 200000000 byte
index = 60000000 byte
overhead = 30000000 byte
total = 290000000 byte = 0.29 GBEnter one million rows, 200 bytes, index factor 0.3, overhead 0.15 and one copy. A 30% factor is 0.3, not 30. These are illustrative assumptions, not universal database constants; replace them with evidence from your schema or measurements.
Both factors apply to the 200 MB base. Overhead is not applied to base plus indexes. The formula is 200 MB × (1 + 0.3 + 0.15). Set each factor to zero in turn to isolate its contribution before investigating unit differences.
Character counts are not row sizes
A hundred visible characters need not be a hundred bytes. Databases also store row and page metadata and handle variable-length values differently. Dividing an exported JSON file by its row count measures JSON representation, not necessarily stored rows. Record what your sample actually measures.
Samples containing only short or empty rows underestimate long content, while maximum lengths can overestimate every row. Try plausible averages such as 200, 400 and 800 bytes. Enter aggregated assumptions, not the original records.
Two copies means two total copies
Two copies produce 580,000,000 bytes. Count the primary: one primary plus one replica is two; plus two replicas is three. baseBytes, indexBytes and overheadBytes describe one copy, while bytes includes all copies. Their difference is not unexplained compression or rounding.
Copies do not model retained backup generations. Estimate backups, logs and temporary workspace separately, then combine them. Avoid adding metadata twice if it was already included in your measured average row size.
GB and GiB can make capacity seem to disappear
290,000,000 bytes is 0.29 GB but about 0.2701 GiB. Nothing disappeared; the units differ. Align billing, OS and calculator units. Share exact byte totals and assumptions alongside readable GB or GiB values.
Explain what drives growth
Doubling rows or average size doubles this model's total. Adding one index is not automatically another 30%; structure matters. Vary one assumption at a time and use sensitivity to decide what to measure next.
Do not derive purchase size, alarms or performance guarantees from this number alone. Updates, maintenance workspace and engine storage behavior lie outside the simple formula. Replace assumptions with measurements as they become available; better inputs matter more than extra decimals.