What DB?  MySQL and PostgreSQL have the exceedingly useful LIMIT
clause, Oracle has ROWNUM which can be used to similar effect.  MS
products have TOP, which can make the first couple pages faster, but
the benfits decrease as you move farther into the result set.  As a
last resort, you could use a temporary table in memory and add a
sequential ID and do a query on the temp table to pull out the records
you want.  Wouldn't be faster on the DB, but it'd save a lot of
network traffic and CFQUERY-ization time.

cheers,
barneyb

On 8/30/05, Snake <[EMAIL PROTECTED]> wrote:
> Like pretty much everyone else, I have always used the following method for
> paging through result sets,
> 
> <cfoutput query="whatever" startfrom="#startfrom#" maxrows="#maxrows#">
> 
> And altering those variables to allow 200 records per page or whatever,
> 
> But this means querying ALL records form the database each time, which can
> be very excessive when your dealing with a very large database.
> Has anyone come up with a good solution of only querying the records you
> actually need (rows 40 -59 for example).
> 
> 
> Russ
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216882
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to