Use of count function

count(*) will not ignore null values

count(1) will not ignore null values

count (column name) will ignore null values

effectiveness:

MyISAM storage engine, with the highest count(*)

InnoDB storage engine, the efficiency of count(*) and count(1)>count(field)

So try not to use count (field) when you use it. Some companies will deduct your bonus because you use count (field) in the production environment.

 

Guess you like

Origin blog.csdn.net/qq_39839828/article/details/105961590