日期:2014-05-16  浏览次数:20839 次

mysql 如何查看哪些表数据量比较大

            数据库中有几十上百张表,那么哪些表的数据量比较大呢,总不能一个表一个表的去查询吧,在mysql中也有类似于oracle的数据字典表,只不过mysql没有oracle记录的那么多和详细,但也足够我们查询这些信息了。

           在mysql的information_schema下有存储数据库基本信息的数据字典表,可以通过查询tables表来获得所需要的表相关信息。

      mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
|mysql             |
|report            |
| report_result      |
|test              |
+--------------------+
5 rows in set (0.02 sec)

mysql> use information_schema;
Database changed
mysql> show tables;
+---------------------------------------+
|Tables_in_information_schema         |
+---------------------------------------+
|CHARACTER_SETS                       |
|COLLATIONS                           |
| COLLATION_CHARACTER_SET_APPLICABILITY |
|COLUMNS                              |
|COLUMN_PRIVILEGES                    |
|KEY_COLUMN_USAGE                     |
|PROFILING                            |
|ROUTINES                             |
|SCHEMATA                             |
|SCHEMA_PRIVILEGES                    |
|STATISTICS                           |
|TABLES                               |
|TABLE_CONSTRAINTS                    |
|TABLE_PRIVILEGES                     |
|TRIGGERS                             |
|USER_PRIVILEGES                      |
|VIEWS                      &nb