Bookmark and Share
How to find fragmented tables?
(Publish Date: 2009-11-8 12:21pm, Total Visits: 2806, Today: 1, This Week: 2, This Month: 6)

mysql -uroot -pxxx -N information_schema < find-fragment-table.sql > fragment-table.sql

$ more find-fragment-table.sql
select concat("optimize table ", TABLE_SCHEMA, '.', TABLE_NAME, ';') from tables where DATA_FREE<>0;

$ more fragment-table.sql
optimize table news.boost_cache_relationships;
optimize table news.boost_cache_settings;
optimize table news.boost_crawler;
optimize table news.boxes;
optimize table news.cache;
optimize table news.cache_apachesolr;
optimize table news.cache_block;
optimize table news.cache_content;

==to fix the problem

$mysql -uroot -pxxx < fragment-table.sql