count(*) is it really expensive ?

Posted by Anil Namde on Stack Overflow See other posts from Stack Overflow or by Anil Namde
Published on 2010-04-27T10:11:25Z Indexed on 2010/04/27 10:13 UTC
Read the original article Hit count: 276

Filed under:
|

I have a page where i have 4 tabs displaying 4 different reports based of different tables.

Now i get row count of each tabled using select count() from table query and display number of rows available in each table on the tabs. Now with each page post back 5 count() queries are executed (4 to get counts and 1 for pagination) and 1 query for getting report.

Now my question is should is count(*) query really expensive that i should keep the row counts (at least which are displayed on tab) in view state of page instead of queering each time? How much expensive it is ?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sql