MySQL · 2022年4月27日 0

MySQL: 统计索引碎片

统计排名前十个索引碎片

select
  table_schema AS db,
  table_name,
      data_free ,
  engine
from
  information_schema.tables
where
  table_schema not in ('information_schema', 'mysql')
  and data_free > 0 order by data_free desc
LIMIT
  10;