mysql数据库和表物理内存

问题:查找aws中的rds占用的物理内存?

 

1.选择information_schema

use information_schema
2.查看information_schema表信息

desc tables;
3.查看数据库所有库的schema

select distinct table_schema from tables;
4.查看指定数据库的物理内存

select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='db_name';
注意:db_name一般是数据库的名称,对应步骤3查询的table_schema

5.查看指定数据库指定表的物理内存

select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='db_name' and table_name='table_name';

posted @ 2020-01-02 15:32  wxhw7021234  阅读(336)  评论(0编辑  收藏  举报