select count(1) from tablename;select count(*) from tablename 的区别
select getdate()
select count(1) from tablename
select getdate()
select count(*) from tablename
select getdate()
tablename表里有80多万条数据
执行了 N遍上面的数据
我竟然发现 select count(*) from tablename 执行的时间大部分情况下竟然比select count(1) from tablename
快一点,偶尔也会慢一点。
我的理解
count(1) 怎么也会比count(*) 快一点,
求高手解惑
谢谢