现象:
select table_rows from information_schema.TABLES where table_name='bcom'
与
select count(0) from bcom
结果不一致
原因:
非实时更新
处理:
执行:Analyze table tableName;
备注:不建议操作,因为会锁表。
快速统计表的记录数:
SELECT SQL_CALC_FOUND_ROWS 1 FROM tableName limit 1;
SELECT found_rows() AS rowcount;