I posted a simple INFORMATION_SCHEMA query to find largest tables last month and it got a good response. Today I needed little modifications to that query to look into few more aspects of data sizes so here it goes:
Find total number of tables, rows, total data in index size for given MySQL Instance
PLAIN TEXT SQL:
- mysql> SELECT count(*) TABLES,
- -> concat(round(sum(table_rows)/1000000,2),'M') rows,
- -> concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA,
- -> concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,
- -> …