我是个java程序员,以前做开发的时候,写sql查询的时候都是用select count(*) from table xxx;的啊,经理给我说,“count(*)的,改成count(主键)”!
为什么select count(主键) from table xxx;比select count(*) from table xxx;效率要高?
...全文
19510打赏收藏
为什么select count(主键) from table xxx;比select count(*) from table xxx;效率要高?
我是个java程序员,以前做开发的时候,写sql查询的时候都是用select count(*) from table xxx;的啊,经理给我说,“count(*)的,改成count(主键)”! 为什么select count(主键) from table xxx;比select count(*) from table xxx;效率要高?