Thursday 13 December 2012

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";

Share This!



No comments:

Post a Comment

Here We Write The Problems we face at different situations and Solutions to those problems.