OK in that case yes. I hadn't actually noticed it was only selecting the
primary KEY as the original code was not in all the subsequent replies. But
then I don't think matey boy had noticed that either, as he didn't mention
it :-)

--
Snake

-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2005 18:27
To: CF-Talk
Subject: RE: Paging through records

> Not in this scenario.
> You have to select ALL records to extract or output the ones you want.

> So my original example was

> 1. query  all the required records
> 2. output the ones you want

> The one your saying is better

> 1. query all the required records
> 2. query a subset of those records
> 3. output the records.

> Thus an extra step to produce the same output. Of course querying the 
> database a second time is going to take up more memory for the 2nd 
> query and take longer to process. If you don't believe me, just try it 
> for yourself.

That's gonna depend on the indexing... the first query returns only the
primary key column (which cuts down on time to execute) and the 2nd query
has only the one primary key column filter in the where clause, which is
presumably faster than searching on other columns (at least, it definately
will be if the db's indexing is done properly).
So it's possible the 2 query approach in this case could actually be
faster... Consider that in the alternative single-query approach, you're
returning x number of columns on y number of records that won't be used,
which will create drag just like the additional query does -- but this 2
query approach also has advantages which reduce the time to complete each
query, so... the end result will vary.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217073
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