下面是我的 mysql 数据库中 2 个表的行数
1是myisam,另一个是innodb,
有人能告诉我为什么 innodb 的数字前面有这个 ~ 吗?
这些数字来自 phpmyadmin
10,308 MyISAM
~118,011 InnoDB
最佳答案
phpMyAdmin 使用 SHOW TABLE STATUS
获取表的信息。
来自documentation :
Rows
The number of rows. Some storage engines, such as MyISAM, store the exact count. For other storage engines, such as InnoDB, this value is an approximation, and may vary from the actual value by as much as 40 to 50%. In such cases, use SELECT COUNT(*) to obtain an accurate count.
这是因为 InnoDB 是一个 ACID兼容的存储引擎。 InnoDB 实现 MVCC使用行级 locking .简而言之,在给定时间可以有给定行的多个副本。我建议阅读这篇文章:Understanding InnoDB MVCC .
关于mysql - 为什么我的 InnoDB 表的记录数有一个奇怪的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1252008/