查询的sql如下:
SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name',
table_rows AS 'Number of Rows', -- 行数
CONCAT(ROUND(data_length/(1024*1024*1024),6),' G') AS 'Data Size', -- 数据大小
CONCAT(ROUND(index_length/(1024*1024*1024),6),' G') AS 'Index Size' , -- 索引大小
CONCAT(ROUND((data_length+index_length)/(1024*1024*1024),6),' G') AS'Total' -- -总大小
FROM information_schema.TABLES
WHERE table_schema LIKE 'ry';
SQL查询:获取数据库表信息
该SQL查询从information_schema.TABLES中检索指定数据库(ry)的表名、行数、数据大小、索引大小及总大小。结果以吉字节(G)为单位展示,适合数据库性能分析。
10万+

被折叠的 条评论
为什么被折叠?



