Определить размер таблиц

SELECT   TABLE_NAME AS `Table`,   ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM   information_schema.TABLES WHERE   TABLE_SCHEMA = "имя базы" ORDER BY   (DATA_LENGTH + INDEX_LENGTH) DESC limit 15;

Количество записей в таблице + размер

SELECT table_name AS 'Table', table_rows as Rows,
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS 'Size (MB)'
FROM information_schema.TABLES
WHERE table_schema = "db_dev_2018_09_12_07_32" ORDER BY (data_length + index_length) DESC;

 

 

MYSQL

Related Articles

0 Comment

Leave a Comment

Ваш адрес email не будет опубликован.