1. 查看数据库的索引空间大小
在MySQL Workbench中运行以下SQL语句:
-- 以GB为单位
SELECT
CONCAT(ROUND(SUM(index_length)/(1024*1024*1024), 6), ' GB') AS 'Total Index Size'
FROM
information_schema.TABLES
WHERE
table_schema LIKE 'database';
-- 以MB为单位
SELECT
CONCAT(ROUND(SUM(index_length)/(1024*1024), 6), ' MB') AS 'Total Index Size'
FROM
information_schema.TABLES
WHERE
table_schema LIKE 'database';