My experience with this is that QoQ are are (really) slow when compared with using structs or arrays. I had a one experience where it brought execution time down from 15-20 seconds using QoQ to 1 or 2 seconds for an array. Generally I create an array of the values I want to look up.
EmpArray[1][ID] = tblEmp.Fname EmpArray[2][ID] = tblEmp.Email etc... Even if you use a sub query or a Join to pull these values you are going to hitting the tblEmp table for every record. This way you only hit tblEmp once.. But then again with proper indexes the database route may be faster... so 6 of one or 1/2 dozen of another. G! On Tue, Jul 13, 2010 at 12:19 PM, Michael Dinowitz < mdino...@houseoffusion.com> wrote: > > I've got a loop which will need to look up a piece of data on each > iteration. The data is standardized so there is really just one call > to the database (outside the loop). I can either do a query of queries > on each iteration or I can turn the query into a structure and do a > structure lookup (structkeyexists, etc) on each iteration. I'm > assuming that the struct lookup will be faster/more efficient even > after having to turn the query into a structure. > Anyone have an opinion on this? > > Thanks > > -- > Michael Dinowitz > Lead Author - Adobe Coldfusion Anthology > > http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335359 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm