gpt4 book ai didi

mysql - Innodb 显示不正确的计数(id)

转载 作者:行者123 更新时间:2023-11-29 03:50:41 25 4
gpt4 key购买 nike

有一个约 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com