select concat(round(sum(data_length)/(1024*1024),2) + round(sum(index_length)/(1024*1024),2),‘MB‘) as ‘DB Size‘ from tables where table_schema=‘tspdata‘;
-- 查看数据所占的空间大小
select concat(round(sum(data_length)/(1024*1024),2),‘MB‘) as ‘DB Size‘ from tables where table_schema=‘tspdata‘;
-- 查看索引所占的空间大小
select concat(round(sum(index_length)/(1024*1024),2),‘MB‘) as ‘DB Size‘ from tables where table_schema=‘tspdata‘;