Thursday, December 13, 2012
5:37 PM

Find Size of table and Size of Index in MySQL Command Prompt

To find Size of table in MySQL command prompt use below command

mysql > SELECT table_name AS "Table", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "database_name" AND table_name = "table_name";


To find Size of  Index of a table in MySQL command prompt use below command

mysql > SELECT table_name AS "Table", round(((index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "database_name" AND table_name = "table_name";

0 comments:

Post a Comment