mysql 查询库表磁盘占用

查整个库的状态:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
          concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
          concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
          concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
  from information_schema.tables
where TABLE_SCHEMA = ‘databasename‘;

查单表:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
          concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
          concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
          concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
  from information_schema.tables
where TABLE_NAME = ‘tablename‘;

mysql 查询库表磁盘占用,布布扣,bubuko.com

mysql 查询库表磁盘占用

上一篇:Asp.NET MVC 拍卖网站,拆解【1】预览与目录


下一篇:linq,sql,lambda转换工具(推荐新手,初学者多多使用)