mysql count(1)、count(*)与count(列名)的执行区别

这次测试 是mysql  5.7.18版本mysql 1.执行效率上: 列名为主键,count(列名)和count(1) 和  count(*) 执行效率是同样的:由于 explain 中 type 类型都为 index 列名不为主键,并且列名没有建立索引  可是 其余字段建立了索引:count(1) = count(*) > count(列名)  :由于expalin 中的 type 类型 co
相关文章
相关标签/搜索