How to know the actual size of your MySQL database tables

        Web Design

The file size of a MySQL database dump is not necessarily the size of that information when it’s deployed in the database. In addition to that, when you are debugging data issues, it’s crucial to review the size of your database tables.

With this SQL query you will get a report of the tables in your database, with their corresponding size:

SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" 
FROM information_schema.TABLES 
WHERE table_schema = "project" 
ORDER BY (data_length + index_length) DESC;

Just ensure to replace the table_schema name with the one you’re using in your project.

About Luis Cuellar

Co-founder and Agile Coach, in charge of leading, managing and coaching agile project teams to achieve a high level of performance and quality in delivering projects that provide exceptional business value to government agencies and nonprofit organizations.
This entry was posted in Web Design and tagged , , . Bookmark the permalink.

Comments are closed.