shishanglian

导航

MySQL 优化 - Count

 

 

https://mp.weixin.qq.com/s/lbn3w3KTcpwrNiQLkyWYew

 

由此,最后count的性能从高到低是:

count(*) ≈ count(1) > count(id) > count(普通索引列) > count(未加索引列)

所以,其实count(*)是最快的。

意不意外,惊不惊喜?

千万别跟select * 搞混了。

posted on 2022-11-21 18:36  嘉合  阅读(89)  评论(0)    收藏  举报