count(*) is it really expensive ?
- by Anil Namde
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 ?