Count(*) vs Count(1) - SQL Server

后端 未结 13 2081
醉梦人生
醉梦人生 2020-11-21 05:21

Just wondering if any of you people use Count(1) over Count(*) and if there is a noticeable difference in performance or if this is just a legacy h

13条回答
  •  醉梦人生
    2020-11-21 05:54

    I would expect the optimiser to ensure there is no real difference outside weird edge cases.

    As with anything, the only real way to tell is to measure your specific cases.

    That said, I've always used COUNT(*).

提交回复
热议问题