I want to estimate the disk space for 1 million rows.
Currently, I have 8527959 rows, Data Length of 744 MB and Index Length 989.4 MB.
Please let me know if my calculations are correct.
Total Data Length for 1 million rows
Data of 744MB consists of 46500 pages of 16KB blocks (InnoDB page size)
If 46500 pages consist of 8527959 rows, 1 page consists an average of 183 rows.
So, 1 million rows need (1,000,000/183) pages= 5465 pages of 16KB
So, 1 million rows of data need 87.4MB.
Total Index Length for 1 million rows
Indexes of of 989.4MB consists of 61837 pages of 16KB blocks (InnoDB page size)
If 61837 pages consist of 8527959 rows, 1 page consists an average of 138 rows.
So, 1 million rows need (1,000,000/138) pages= 7247 pages of 16KB
So, 1 million rows of data need 115.9MB.
Total disk space (approximate) for 1 million rows
Total data length+Total Index Length = 87.4MB + 115.9 MB = 203.3 MB
Is this correct?
