perfer count(*)html
官方文档:mysql
_InnoDB handles SELECT COUNT(*) and SELECT COUNT(1) operations in the same way. There is no performance difference._sql
阿里手册:数据库
【强制】不要使用 count( 列名 ) 或 count( 常量 ) 来替代 count( * ) , count( * ) 是 SQL 92 定义的
标准统计行数的语法,跟数据库无关,跟 NULL 和非 NULL 无关。
说明: count( * ) 会统计值为 NULL 的行,而 count( 列名 ) 不会统计此列为 NULL 值的行。orm