In this post, I am sharing one script to find total occupied size of each Storage Engine of MySQL Server.
MySQL Provides different types of storage engines like: MyISAM, InnoDB, Memory.
I have seen few questions on open MySQL Forum like: how to migrate MyISAM tables into InnoDB engines and what would be the storage size difference.
Periodically, Database Administrators have to check occupied size of each different MySQL Storage Engine which help them to take decisions on internal migration or for any other reason.
COUNT(*) AS TotalTableCount
,CONCAT(ROUND(SUM(table_rows)/1000000,2),'M') AS TotalRowCount
,CONCAT(ROUND(SUM(data_length)/(1024*1024*1024),2),'G') AS TotalTableSize
,CONCAT(ROUND(SUM(index_length)/(1024*1024*1024),2),'G') AS TotalTableIndex
GROUP BY ENGINE
ORDER BY SUM(data_length+index_length)
DESC LIMIT 10;