Total DB Size and Table

Hi eveybody,

Does pt-toolkit have any command or option to view size of databases and tables? I could not fine such command or option in pt-toolkit package.

Thanks in advance

Hi Nima0102;

There is no specific tool that I know of to show table data size.

You can get an estimate from within MySQL using the following query:

SELECT table_name AS “Table”,round(((data_length + index_length) / 1024 / 1024), 2) “Size in MB” FROM information_schema.TABLES WHERE table_schema = “DB_NAME” AND table_name = “TABLE_NAME”;

This data also shows up if you run “show table status like ‘TABLE_NAME’”.

Note that it is just an estimate, and could vary quite a bit depending on how accurate the internal statistics are currently.