查看MySQL中数据表的数据量

来源:互联网 发布:js 阻止标签跳转 编辑:程序博客网 时间:2024/06/08 02:58

在MySQL中有个库叫information_schema,里面有数据库基本信息的数据字典表,可以通过查询tables表来获得所需要的表相关信息。

SELECT * from `TABLES` ;

这里写图片描述

当我们需要分析数据表中的数据量的时候,可以用如下sql

select table_name,table_rows from tables where TABLE_SCHEMA = 'dataterminaldb2' order by table_rows desc;

这里写图片描述

根据查询结果,我们可以对相应表进行优化。

0 0
原创粉丝点击