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?
SQL Query Optimization: Choosing Between COUNT(*) and COUNT(1)
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


sasikala sRank #1,091 · 1.7K reputationPosted Jul 14, 2025, 8:42 AM EDT
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).