Вот такой запрос нашел на просторах интернета, который выводит в удобочитаемом виде размер таблиц в MB и в rows.
1 2 3 4 5 6 7 8 9 |
SELECT table_name AS table_name, engine, ROUND(data_length/1024/1024,2) AS total_size_mb, table_rows FROM information_schema.tables WHERE table_schema=DATABASE(); |
Пример вывода под катом:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
+-------------------+--------+---------------+------------+ | table_name | engine | total_size_mb | table_rows | +-------------------+--------+---------------+------------+ | ACCOUNTING | MyISAM | 0.00 | 0 | | ACLOSE_STAT | MyISAM | 0.00 | 0 | | ACTIONS | MyISAM | 0.01 | 216 | | AGENTS | MyISAM | 0.00 | 0 | | ALERTS | MyISAM | 0.00 | 0 | | ANI_EXP | MyISAM | 0.00 | 0 | | ANI_GROUP | MyISAM | 0.00 | 0 | | ANI_SET | MyISAM | 0.00 | 0 | | ANI_TYPES | MyISAM | 0.00 | 0 | | ANI_TYPE_NAMES | MyISAM | 0.00 | 0 | | AS_LIST | MyISAM | 0.00 | 0 | | AUTOCLOSE_RULES | MyISAM | 0.00 | 0 | | AUTO_TT | MyISAM | 0.02 | 25 | | BALANCE_HISTORY | MyISAM | 0.00 | 7 | | BUHDOCS | MyISAM | 0.00 | 0 | | BUH_CLIENT_ATTR | MyISAM | 0.00 | 1 | | CARDS_CHARGE | MyISAM | 0.00 | 0 | | CARDS_PAY | InnoDB | 0.02 | 1 | | CDR | InnoDB | 27880.00 | 75521284 | | CDRBUFFER | InnoDB | 0.02 | 7 | | CDRBUFFER_READ | InnoDB | 0.02 | 0 | | CDR_BILL000000 | InnoDB | 0.02 | 1 | | CDR_BILL201401 | InnoDB | 287.91 | 1809322 | | CDR_BILL201402 | InnoDB | 190.78 | 1203849 | | CDR_BILL201403 | InnoDB | 336.95 | 2130310 | | CDR_BILL201404 | InnoDB | 367.00 | 2302771 | +-------------------+--------+---------------+------------+ |