anyone know how to determine the size of an index in mysql(5.1)????
thanks in advance
anyone know how to determine the size of an index in mysql(5.1)????
thanks in advance
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, ...