Michael, I just wrote some functionality for a government project recently that basically merged two Verity result sets and made a few changes to them at the same time. I found that there was nearly no overhead. Basically one result set had to appear AFTER the other (don't ask). Processing the queries using Q of Q with UNION was quite a bit slower, though it's all anecdotal timing under the bridge at this point...
As far as calling a CFC in a loop or sending the whole query to the CFC to be looped over, I couldn't say without testing it both ways, and even then you wouldn't get accurate results unless you load tested. All things being equal, though, it would seem to make the most sense to do whichever way would be most pertinent to the functionality of the app. Will the method be used by any other parts of the program or is it specific to this one process? You might want to create two methods: the public one that takes a query object could call the private method that does the processing on each row. Andy > -----Original Message----- > From: Michael Dinowitz [mailto:[EMAIL PROTECTED] > Sent: Monday, January 17, 2005 12:43 PM > To: CF-Talk > Subject: RE: Extra query info > > The performance of a CFC that has been set as an object is > very good. I'd have to say extremely good with a 0ms hit on > most occasions. As for a performance hit when > building/altering queries, I've never heard of one but I'll > do some tests to be sure. A query 'object' is just like an > array 'object' or structure 'object'. They're all just data > collections. > On the other hand, a QoQ does have some overhead but that's > due to it having a whole query parsing engine and all. Not a > lot of overhead in most cases, but it's not as efficient as > some things (like struct functions). > > > Michael, > > > > I don't know if this will play into it at all, but I seem > to remember > > some people talking about performance hits when you build > new queries > > or add columns/data to existing queries using the query > functions in CF. > > The method of using a CFC to format the data and return a new query > > object may have bad performance in that realm if what I've heard is > > true. Also, once you create the CFC as an object, you > should be able > > to make as many calls as you want to it without nearly as much > > overhead. I have no data to back that up, but from what > I've heard, > > that seems like it'd be the case. If I'm wrong, I'd love > to hear about it. > > > > > > John Burns > > Certified Advanced ColdFusion MX Developer AI-ES Aeronautics, Web > > Developer > > > > -----Original Message----- > > From: Michael Dinowitz [mailto:[EMAIL PROTECTED] > > Sent: Monday, January 17, 2005 12:29 PM > > To: CF-Talk > > Subject: Extra query info > > > > Here's a conceptual question. Lets say you have a query > with multiple > > rows in it. There is a few calculations that will take > place between > > items in a row to get some additional values per row (i.e. > a discount > > price, etc.). > > One way of doing this is when outputting the query, you send the > > specific data to a CFC (It's used in multiple places) and get out a > > structure. This means that a 20 row query has 20 calls to the CFC. > > Another way of doing it is to pass the whole query to a CFC > which will > > then loop over the query, do the calculations and then place the > > results into new columns within the query. > > The first has a single loop but multiple CFC calls while the second > > has > > 2 loops (inside the CFC and out) but a single CFC call. > > Which do you prefer? Do you see a problem with either approach? > > Just something that came into my mind while rewriting a few dozen > > pages on this ecommerce site. > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:190816 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

