at least on MyISAM tables, count(*) should be faster than count(fliedname) since it allows mysql to use the index (primary key more often) for counting. if the given field name is the primary key, it has no meaning.
with * , mysql wont will dump โload entire row dataโ like others said - count(*) always the fastest or one of the fastest options, and count(fieldname) can be slower, depending on which field set.
EDIT :
the documentation says:
COUNT (*) is optimized for quick return [...]. This optimization applies only to MyISAM tables.
read the documentation for more information on this topic.
Important note: count(*) returns the total number of rows, and count(fieldname) returns the number of rows in which a non- NULL field is specified. this is logically consistent since with * mysql it cannot know what to leave NULL values. always think about it when doing count() , as this can have a bicomputer effect on the result.
source share