Get MySQL tables having free space for optimize
The following query lists tables with free space greater than equal to 50MB to optimize
Example response:
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:
+---------------------------------+-----------------+----------------+--------------+
| TABLE_NAME | TABLE_SCHEMA | data_length_mb | data_free_mb |