数码资讯
MySQL数据库查看数据表占用记录的大小和数量的方式。
如果你想知道空间在MySQL数据库的每个表占用和记录表中的行数,你可以打开MySQL information_schema数据库。在图书馆里,有一个表格,这是主要的领域: table_schema:数据库名称 table_name:表名 引擎:使用的存储引擎 tables_rows:记录数 data
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
如果你想知道空间在MySQL数据库的每个表占用和记录表中的行数,你可以打开MySQL information_schema数据库。在图书馆里,有一个表格,这是主要的领域:
table_schema:数据库名称
table_name:表名
引擎:使用的存储引擎
tables_rows:记录数
data_length:数据大小
index_length:索引的大小
对于其他领域,请参考MySQL的手册,这对我们最有用。
占空间的表的大小,相当于数据的大小和索引的大小,
实例:
1。想看到所有的HX库表的大小,你可以使用:
复制代码代码如下所示:
选择table_name,data_length + index_length,从information_schema.tables哪里table_schema = 'hxtable_rows;
+ + + + ------------------- -------------------------- ------------
table_name data_length + index_length table_rows | | | |
+ + + + ------------------- -------------------------- ------------
| enjoy_data | 6979584 | 70113 |
| hx_record | 113410048 | 753279 |
| itlearner_record | 21835546624 | 104917777 |
| tmp_day_id | 17326 | 811 |
+ + + + ------------------- -------------------------- ------------
2。想看喜欢的HX库表的大小,可以使用:
复制代码代码如下所示:
选择data_length + index_length,从information_schema.tables哪里table_schema = 'hx'and table_name = 'enjoy_datatable_rows;
回归uff1a
复制代码代码如下所示:
-------------------------- ------------ + + +
| data_length + index_length | table_rows |
-------------------------- ------------ + + +
| 6979584 | 70113 |
-------------------------- ------------ + + +
table_schema:数据库名称
table_name:表名
引擎:使用的存储引擎
tables_rows:记录数
data_length:数据大小
index_length:索引的大小
对于其他领域,请参考MySQL的手册,这对我们最有用。
占空间的表的大小,相当于数据的大小和索引的大小,
实例:
1。想看到所有的HX库表的大小,你可以使用:
复制代码代码如下所示:
选择table_name,data_length + index_length,从information_schema.tables哪里table_schema = 'hxtable_rows;
+ + + + ------------------- -------------------------- ------------
table_name data_length + index_length table_rows | | | |
+ + + + ------------------- -------------------------- ------------
| enjoy_data | 6979584 | 70113 |
| hx_record | 113410048 | 753279 |
| itlearner_record | 21835546624 | 104917777 |
| tmp_day_id | 17326 | 811 |
+ + + + ------------------- -------------------------- ------------
2。想看喜欢的HX库表的大小,可以使用:
复制代码代码如下所示:
选择data_length + index_length,从information_schema.tables哪里table_schema = 'hx'and table_name = 'enjoy_datatable_rows;
回归uff1a
复制代码代码如下所示:
-------------------------- ------------ + + +
| data_length + index_length | table_rows |
-------------------------- ------------ + + +
| 6979584 | 70113 |
-------------------------- ------------ + + +
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。