mysql索引

查看数据大小
SELECT CONCAT(ROUND(SUM(data_length)/(1024*1024), 2), ' M')  AS 'Total Data Size'
FROM information_schema.TABLES WHERE table_schema = 'testus';

查看索引大小
SELECT
CONCAT(ROUND(SUM(index_length)/(1024*1024), 2), ' M')  AS 'Total Index Size'
FROM information_schema.TABLES
WHERE table_schema = 'testus';

查看总大小
SELECT
CONCAT(table_schema,'.',table_name) AS 'Table Name',
table_rows 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 = 'testus';

  1. da shang
    donate-alipay
               donate-weixin weixinpay

发表评论↓↓