Reblogged from SQL Server Portal:
Today, we will discuss the efficient way to count records of any table. Lets suppose you have millions of records in a table. How will you calculate the record count quickly ?
Let me explain this with simple examples :
Example 1 :
First, lets use the traditional way to count records from the table.
As per the results, the above query took almost 26 seconds.
I ran into Muhammand's blog on decreasing row count cost and thought it was a great tip to use in the future!
