日期:2014-05-16  浏览次数:20865 次

mysql 清理碎片
显示你数据库中存在碎片的全部列表:
  select table_schema, table_name, data_free, engine
   from information_schema.tables
    where table_schema not in ('information_schema', 'mysql') and data_free > 0;

如果你发现一些列表中包含了大量的数据留空现象,那么对其进行优化是绝对值得的,因为这一过程会大大提升列表的读取性能及应用表现。
  optimize table tableName;