Optimized way to get count of rows from a table
To get no. of rows from a table we usually use query
Select count(*) from table_name
But this query reads complete table to return no. of
Optimized way for performing this query is
Select rows from sysindexes where id= Object_Id(‘table_name’)
Technorati Tags: Sql Sever