Pular para o conteúdo

PopSQL: suporte limitado.

Migrar agora →

Maiores tabelas e o espaço livre delas

Dados, índices e espaço recuperável por tabela. Um data_free grande é fragmentação que um OPTIMIZE TABLE recuperaria.

MySQL · SQL
SELECT CONCAT(table_schema, '.', table_name) AS table_name,
       table_rows AS estimated_rows,
       ROUND((data_length + index_length) / 1048576, 1) AS total_mb,
       ROUND(data_length / 1048576, 1) AS data_mb,
       ROUND(index_length / 1048576, 1) AS index_mb,
       ROUND(data_free / 1048576, 1) AS free_mb
FROM information_schema.tables
WHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')
  AND table_type = 'BASE TABLE'
ORDER BY (data_length + index_length) DESC
LIMIT 25

Esta consulta faz parte do pacote "Saúde do MySQL": conecte o banco no DataRunner e instale o pacote inteiro — consultas, painel e verificações — de uma vez.