Possible Duplicate:
COUNT(*) vs. COUNT(1) vs. COUNT(pk): which is better?
I want to retrieve the count from a select query.
What is faster: count(*) or count(table_field_name)?
I want to know which way is faster for performance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is
Count(field)returns count of NOT NULL values in the field, whetherCOUNT(*)returns COUNT of rows.COUNT(*)in MyIsam should be faster.http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count