Get MySQL tables having free space for optimize
Submitted by system on Sat, 10/01/2022 - 15:22The following query lists tables with free space greater than equal to 50MB to optimize
mysql> select table_name, table_schema, round(data_length/1024/1024) as data_length_mb, round(data_free/1024/1024) as data_free_mb from information_schema.tables where round(data_free/1024/1024) > 50 order by data_free_mb;
Example response: