为什么我的InnoDB表的记录计数值很奇怪? [英] Why does my InnoDB table have a weird value for record count?
问题描述
下面是我的mysql数据库中2个表的行数
1是myisam,另一个是innodb,
有人可以告诉我为什么innodb的数字前面有这个〜吗?
这些数字来自phpmyadmin
10,308 MyISAM
~118,011 InnoDB
phpMyAdmin使用SHOW TABLE STATUS
获取有关表的信息.
从文档:>
行
行数.某些存储引擎(例如MyISAM)存储准确的计数.对于其他存储引擎,例如InnoDB,此值是一个近似值,可能与实际值相差40%到50%.在这种情况下,请使用SELECT COUNT(*)获得准确的计数.
这是由于InnoDB是 ACID 兼容的存储引擎. InnoDB使用行级 Below is the ammount of rows for 2 tables in my mysql DB can someone tell me why the innodb one has this ~ in front of the number? These numbers came from phpmyadmin
phpMyAdmin uses From the 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. This is due to InnoDB being an ACID compliant storage engine. InnoDB implements MVCC using row-level locking. In short, there can be multiple copies of a given row at a given time. I suggest reading this article: Understanding InnoDB MVCC. 这篇关于为什么我的InnoDB表的记录计数值很奇怪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
1 is myisam the other innodb, 10,308 MyISAM
~118,011 InnoDB
SHOW TABLE STATUS
to get information for your tables.