Created
October 25, 2016 09:45
-
-
Save rambolee/1c6ce3dc53e13d7364ac4efa7a7fd2a3 to your computer and use it in GitHub Desktop.
统计 MySQL 表大小
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name', | |
CONCAT(ROUND(table_rows/1000000,2),'M') AS 'Number of Rows', | |
CONCAT(ROUND(data_length/(1024*1024),2),'M') AS 'Data Size' , | |
CONCAT(ROUND(index_length/(1024*1024),2),'M') AS 'Index Size' , | |
CONCAT(ROUND((data_length+index_length)/(1024*1024),2),'M') AS 'Total' | |
FROM information_schema.TABLES | |
WHERE table_schema='ump' order by Total desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment