How do I determine the size of an index in MySQL 5.1?
Asked
Active
Viewed 2,759 times
2 Answers
4
Use INFORMATION_SCHEMA.TABLES
Example : For a table called mydb.mytable, run this query
SELECT index_length NDXSIZE FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema='mydb' AND table_name='mytable';
Answer comes back in bytes. If you want the answer in KB do this:
SELECT index_length/POWER(1024,1) NDXSIZE FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema='mydb' AND table_name='mytable';
For MB, use POWER(1024,2)
For GB, use POWER(1024,3)
etc, etc, ...

RolandoMySQLDBA
- 43,883
- 16
- 91
- 132
-
@user491757 - welcome to SO. "Signatures" in answers are generally discouraged - people will go look at your profile page if they're interested: http://stackoverflow.com/users/491757/user491757 More details in the FAQ: http://stackoverflow.com/faq – McDowell Oct 29 '10 at 21:25