On Fri, 13 Feb 2004, Robert Twitty wrote:

> If you are not opearating in a stateless environment, then you could use a
> cursor.  The web is a stateless environment, and therefore the record set
> needs to be cached either to disk or memeory.  The other alternative is to
> rerun the query for each page request.  Using disk space to store query
> results for the purpose of paging over the web is commonly done by search
> engines, and even some database engines use disk space for cursor
> implementation.  I agree that using session variables for this purpose is
> not ideal, but what's the alternative in PHP?  Storing only the
> identifiers instead of all the data significantly lessons the impact.
>
> I agree, it should be avoided if possible.

If you are running it out of a DB, limiting the results to result 1-10 or
91-100 is pretty fast; caching results seems like more of a headache to me,
and depending on how loaded your DB is, not worth the effort.

If the query takes 3-5 seconds, then either your DB is configured wrong (no
indexes), or your SQL is not written well, or you should consider some sort
of DB query caching.  Look to the manual for that.

---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
[EMAIL PROTECTED]                             http://www.purplecow.com/
---------------------------------------------------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to