2009/7/6 Miller, Terion <tmil...@springfi.gannett.com>:
> Ok, say you have a database with 16000 records in it, but you only want to
> call out say 2000 records at a time as the search/query is performed, then
> store the first 2000 in a session and then retrieve the next 2000 etc etc as
> a way to minimize server strain?
> (I'm tasked to do this and ....)
> 1. don't know what this is called to google it...partioning results/data ???
> 2. Is there a better way to deal with retrieval of large amounts of data
> from a large table without choking the server.....
> 3. Is it possible at all....
> Basically I need to know what it is I'm looking to do, it's not getting
> explained in an understandable way here....which makes google useless....

Generally known as paging, and every database server I'm aware of supports it.

MySQL for example...

select * from table limit <page>,<numrows>

I would strongly recommend against storing any large dataset in a
session since it will likely be as expensive to load it in as it would
be to do the database query again.

Based on the way you've phrased your question and the 2000 per page
I'm guessing you're not doing this for display purposes. If you're
wanting to lighten the load on the server while you process the 16,000
rows you might want to look into mysql_unbuffered_query which requires
a lot less memory than mysql_query. See the manual for details.



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

Reply via email to