有一个约 3G 文件大小的 innodb 表(我使用 innodb_file_per_table = 1),刚刚从转储和 ~1.3G 转储文件中导入。不知道这里有多少记录。
当我执行“select count(id) from $table”时,我看到“27117291”(为了便于阅读,27,117,291)。 当我执行“select count(id) from $table limit 100”时,我还看到了“27117291”
为什么会这样? InnoDB 真的比 MyISAM 更好吗?!
附言如果我执行“select count(id) from $table where id=73010460;”我看到“1”。
最佳答案
select count(id) from $table
返回包含计数的一行。所以您的限制没有任何区别。
( Reference )
+-----------+
| COUNT(id) |
+-----------+
| <count> |
+-----------+
关于mysql - Innodb 显示不正确的计数(id),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13214496/