Thursday, November 1, 2012

How to find table size in MySql using workbench?

If you want to calculate memeory usage of all yout tables in your database as we did in mysql admintrator tool then simply the following query:


SELECT table_name "Tables",
( data_length + index_length ) / 1024 /
1024 "Table Size in MB",
( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
where table_schema="YOUR SCHEMA NAME"

You need to change only the SCHEMA NAME only.

Try it and let me know your feedback.

Enjoy!!!