Una semplice query per tenere d’occhio la situazione delle tabelle e degli indici di MySQL.
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;
(via Boris Huisgen)
Lascia un commento