> 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:217019
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to