解决innodb count速度慢的方法:
1. 使用二级索引执行查找
2. explain select count from Table; 然后查看rows
3. SELECT COUNT FROM tables use indexnon-primarykey;
4. select count from tables where …… and 1; ??
5. show index from tables; 然后查看 index cardinality.
6. show table status like table; 得到大概数字
7. 自己产生一个计数表去统计count.
转载请注明:Findever » innodb下count提速