Thursday, June 27, 2013

mysql: find InnoDB table size

How to find Innodb tables size?

"show table status" command doesn't show separated Innodb tables size, it showes total InnoDB data size. So we can use INFORMATION_SCHEMA for finding size of each InnoDB table.

for example, try  find 10 biggest InnoDB tables:

#mysql -A


mysql> use INFORMATION_SCHEMA
mysql> SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE, TABLE_ROWS, DATA_LENGTH, INDEX_LENGTH, CREATE_TIME, UPDATE_TIME FROM TABLES WHERE ENGINE='InnoDB' ORDER BY DATA_LENGTH DESC limit 10;



using  INFORMATION_SCHEMA you can find data_length, index_length and other useful information

No comments: