0

Why is COUNT(*) so much quicker than COUNT(field), Even when field is an index?

I am using MySQL

1 Answer 1

4

COUNT(field) will not count that row when field is null, so there is an additional check it must do.

COUNT(*) simply counts rows.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.