On 5/29/06, Mikey C <[EMAIL PROTECTED]> wrote:
I am using a web front end to display paged results. I need to tell the user how many records there are in total, how many pages and which page they are viewing. I would like to use the LIMIT keyword to restrict the result using the two parameters (offset and limit count) so that I do not waste resources loading up 1000's of records just to discard the ones not on the current page.
If you can eliminate the requirement of giving the user a scroll bar or a count of results then the need to get a count goes away. If you can do it you're much better off forcing the user to accept only the first N results of any search. Nobody uses more than 10 pages or so of any interactive result set and most people don't use more than the first couple of pages. It really speeds things up and simplifies things when you don't have to deal with very large results. The users won't look at them anyway. The last time I had to do this I had to go through a lot of trouble to get it to work acceptably fast. I wrote special code to return the first page then do all the indexing for the remaining pages while the user was looking at the first page. -- SqliteImporter, SqliteReplicator: Command line utilities for Sqlite http://www.reddawn.net/~jsprenkl/Sqlite