Index size of a mysql database

Asked

Viewed 392 times

-1

What the structure of a query to achieve full size in MB of all the index of the tables of a given banco de dados in mysql?

1 answer

1


Look at this:

select database_name, table_name, index_name, stat_value*@@innodb_page_size
from mysql.innodb_index_stats where stat_name='size';

This is also interesting:

SELECT concat(table_schema,'.',table_name),
concat(round(table_rows/1000000,2),'M') rows,
concat(round(data_length/(1024*1024*1024),2),'G') DATA,
concat(round(index_length/(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(index_length/data_length,2) idxfrac 
FROM information_schema.TABLES 
ORDER BY data_length+index_length DESC LIMIT 20;

https://stackoverflow.com/questions/781873/how-to-figure-out-size-of-indexes-in-mysql

  • thanks for the help but I managed to do otherwise

Browser other questions tagged

You are not signed in. Login or sign up in order to post.