SELECT
table_schema AS "数据库",
table_name AS "表名",
table_rows AS "记录数",
TRUNCATE (data_length / 1024 / 1024, 2 ) as "数据容量(MB)",
TRUNCATE ( index_length / 1024 / 1024, 2 ) as "索引容量(MB)"
FROM
information_schema.TABLES
WHERE
table_schema = 'business_prod'
AND TABLE_NAME in( 'real_time_data','real_time_data_copy1')
ORDER BY
data_length DESC,
index_length DESC
mysql查询表内数量及大小
于 2024-06-20 10:43:43 首次发布