MySQL : vérifier l'occupation disque des tables & index

Boris HUISGEN
Boris HUISGEN
SELECT CONCAT(table_schema, '.', table_name) db_table,
       CONCAT(ROUND(table_rows/1000000, 2), 'M') rows,
       CONCAT(ROUND((data_length+index_length)/(1024*1024), 1), 'M') size,
       CONCAT(ROUND(data_length/(1024*1024), 1), 'M') data,
       CONCAT(ROUND(index_length/(1024*1024), 1), 'M') indx,
       ROUND(index_length/data_length, 2) ratio
FROM   information_schema.TABLES
ORDER  BY data_length + index_length DESC;
Boris HUISGEN
Boris HUISGEN
Blog owner
  • #mysql