> Consider the following 2 ways of searching through objects of a
> certain type:
> 
> #1
> 
> <cfa_contentObjectFind dataSource="some_dsn" typeID="#type_Ducks#"
> r_lObjects="lDucks" bactiveonly="no">
> <cfloop list="#lDucks#" index="idxlDucks">
>       <cfa_contentObjectGet dataSource="some_dsn" objectID="#idxlDucks#"
> r_stObject="stDuck">
>       <cfif stDuck.Weight gt 2>
>               <!--- do stuff --->
>       </cfif>
> </cfloop>
> 
> #2
> 
> <cfa_contentObjectFind dataSource="some_dsn" typeID="#type_Ducks#"
> r_stObjects="stDucks" bactiveonly="no">
> <cfloop collection="#stDucks#" item="keystDucks">
>       <cfif stDucks[keystDucks].Weight gt 2>
>               <!--- do stuff --->
>       </cfif>
> </cfloop>
> 
> The first method returns a list of object IDs, while the second
> returns a structure of object data. Which way is faster?

See my other email. The r_stobjects method is faster because it retrieves
all objects. If you use r_lobjects there is a possibility that you will
hit the database for each cfa_contentobjectget.

-- 
Michiel Boland <[EMAIL PROTECTED]>
Digital Valley Internet Professionals
Plantsoen 17, Wageningen, The Netherlands
Phone: +31 317 465555, Fax: +31 317 460276


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to