Excellent logic Bart. Very simple, no sessions needed, no caching, no
persistant db connection.  Turns out, fetching through the rows one by one
until you got the point where you get the ones you want is extremely fast:

while (@row = $result->fetchrow_array)
{
        $count++;
            if ($count >= $start and $count <= $finish)
        {
                print bla
        

I ran a SELECT count(field) query the first time to determine how many
results there are.  Then display the first 10 (making sure to $dbh->finish
after 10)

1 - 10 of 912 | Next 10 >>>

I took a query with 1000 results at 15 seconds to display the entire list,
down to 1 second to display a selected 10 out of 1000.   I stepped through
to 400:

391 - 400 of 912 | Next 10 >>>

....and did not notice any decrease in performance.  I'd love to have time to
benchmark this.  



-----Original Message-----
From: Bart Lateur [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 7:11 PM
To: [EMAIL PROTECTED]
Subject: Re: 1-10, 11-20

The chances of you needing, say, rows 2101 through 2110 are pretty slim.
People generally will browse through the first couple of pages, and then
give up and redo a finer search.

So, if your DB doesn't support LIMIT, just fetching the rows one by one
until you've got to the point where you get the ones you want now, that
looks practically feasable.

Don't forget to "finish", as you will generally not read until the end.

-- 
        Bart.

Reply via email to