Hi, I have a DB table with approx. 100,000 entries.
My web app will show paged results of search queries, which may yield between 0 and 100,000 records.
When generating the output I want to do two things:
- Show total nr of results
- Show paged view, with 50-100 results per page.
Obviously I would like to query records for just one page at a time from DB, but here is a dilemma - how do get the COUNT() without running the entire query?
And if I have to run the entire query, isn't it better to select it all and cache in memory?
What do you usually do in such a case, if we are in the range of 100 krecords per result set?
Basically, What the most efficient way to be able to show both "found xxxxx results" message and results split into pages ?