码迷,mamicode.com
首页 > 数据库 > 详细

Finding out largest tables on MySQL Server

时间:2020-03-31 17:32:47      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:sch   row   nbsp   size   ble   dex   length   format   desc   

 
SELECT CONCAT(table_schema, ‘.‘, table_name),
       CONCAT(ROUND(table_rows / 1000000, 2), ‘M‘) rows,
       CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), ‘G‘) DATA,
       CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), ‘G‘) idx,
       CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), ‘G‘) total_size,
       ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;

Finding out largest tables on MySQL Server

标签:sch   row   nbsp   size   ble   dex   length   format   desc   

原文地址:https://www.cnblogs.com/liang545621/p/12606430.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!