I have a database table with approx. 100,000 entries.
My web application will display the results of paged search queries , which can contain from 0 to 100,000 entries.
When generating the output, I want to do two things:
- Show total results
- Show pagination with 50-100 results per page.
Obviously, I would like to request records for only one page at a time from the database, but here's the dilemma: how to get COUNT () without doing the whole query?
And if I need to run the entire request, is it not better to select it and cache it in memory?
What do you usually do in this case, if we are in the range of 100 quests for the result set?
Basically,
What is the most effective way to show both "found xxxxx results" and the results are paginated?
source
share