小编sur*_*r80的帖子

为什么数据库表 TABLES.table_rows 列与 MySQL 中物理表中的 select count(*) 不匹配

将 information_schema.TABLES.table_rows 列与从“SELECT count(*) from”检索到的物理行计数进行比较时,数字不匹配。为什么行数不同?

mysql> select TABLE_ROWS from TABLES where TABLE_NAME = 'gbl_session' and TABLE_SCHEMA = 'mydb';
+------------+
| TABLE_ROWS |
+------------+
|       7306 |
+------------+
1 row in set (0.01 sec)

mysql> select count(*) from mydb.gbl_session;
+----------+
| count(*) |
+----------+
|     7800 |
+----------+
1 row in set (0.01 sec)
Run Code Online (Sandbox Code Playgroud)

mysql database count information-schema

5
推荐指数
1
解决办法
3413
查看次数

标签 统计

count ×1

database ×1

information-schema ×1

mysql ×1