mysql常用命令汇总

1.查询表占用空间语句: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 '%data_platform%'
ORDER BY `Data Size` desc;
posted @ 2022-06-23 17:17  奈何技术不达标  阅读(25)  评论(0编辑  收藏  举报