Not the answer you need?
Register and ask your own question!

Total DB Size and Table

nima0102nima0102 EntrantInactive User Role Beginner
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

Comments

  • scott.nemesscott.nemes MySQL Sage Current User Role Patron
    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.

    -Scott
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.