为什么对主键的简单查询在MySQL中会超时到100万条记录?
即。 从table_name中选择计数(*)
Innodb表不存储表的计数。 因此select COUNT(*)...需要读取所有行。
select COUNT(*)...
可以使用information_schema.tables找到一个粗略的估计。