I recently got into a discussion about whether it's better to use COUNT(*) or COUNT(1) in SQL queries. Does it make any difference in terms of performance?
Loading
I recently got into a discussion about whether it's better to use COUNT(*) or COUNT(1) in SQL queries. Does it make any difference in terms of performance?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sasikala sPosted Jul 14, 2025, 12:42 PM
COUNT(*): Counts all rows in a table, including rows withNULLvalues in any column.COUNT(1): Also counts all rows, but evaluates the constant1for each row.There is no significant performance difference between
COUNT(*)andCOUNT(1).