How to know the actual size of your MySQL database tables

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.


Do you need some help?

Let's get started. Tell us a little about yourself and your organization
and we can start a conversation about your needs and our capabilities.

Related Posts