gkganeshbe (12/26/2012)
Is there any performance difference in the below given three queries.Note: Col1 is NOT NULL column
SELECT COUNT(*) FROM Sales.SalesOrderDetail;
SELECT COUNT(Col1) FROM Sales.SalesOrderDetail;
SELECT COUNT(0) FROM Sales.SalesOrderDetail;
Not really. The second one with COUNT(Col1) may take a very small performance hit during the parse and bind phases, to check whether there is a Col1 column and if it's nullable, but that is an extremely short amount of time.