Home > Linux > How to get size of Mysql tables

How to get size of Mysql tables

In the previous post I wrote about a way to get a Mysql database size from Mysql shell. Now I’d like to share a way to get size of each Mysql table:

SELECT table_name,`engine` ,ROUND(data_length/1024/1024/1024,2) total_size_gb, ROUND(index_length/1024/1024/1024,2) total_index_size_gb, table_rows FROM information_schema.TABLES WHERE table_schema = ‘rt3′;

It’s useful if you need to know what you should clean in your huge database.

[via Techie-Gyan]

Categories: Linux Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes