mysql查看数据库中表的大小、索引大小

SELECT concat(round(table_rows/1000000,2),'M',' rows') as table_rows,concat(round(data_length/(1024*1024*1024),2),'G',' DATA') as data_size,concat(round(index_length/(1024*1024*1024),2),'G',' idx') as index_size,concat(round((data_length+index_length)/(1024*1024*1024),2),'G',' total_size') as total_size,concat(round(index_length/data_length,2),' idxratio') as index_ratio,concat(table_schema,'.',table_name) as table_name FROM information_schema.TABLES ORDER BY data_length+index_length DESC LIMIT 10\G;
 

你可能感兴趣的:(mysql)