Wouldn't these functions be applied to the result set that is already picked (after looking through the index, etc to find the proper rows). In that case, I don't see how the aggregate functions are affected by the index.
Russ > -----Original Message----- > From: Robertson-Ravo, Neil (RX) [mailto:Neil.Robertson- > [EMAIL PROTECTED] > Sent: Tuesday, July 25, 2006 2:37 PM > To: CF-Talk > Subject: Re: Cool feature I didn't know about > > Not true all the time, it can however have overhead in SQL, a SUM function > at the DB, on a say a bad index can have huge consquences. > > > > > > > > "This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, > Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of > the > intended recipient(s). If you are not the intended recipient(s) please > note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or > call > our switchboard on +44 (0) 20 89107910. The opinions expressed within > this > communication are not necessarily those expressed by Reed Exhibitions." > Visit our website at http://www.reedexpo.com > > -----Original Message----- > From: Josh Nathanson <[EMAIL PROTECTED]> > To: CF-Talk <[email protected]> > Sent: Tue Jul 25 19:53:23 2006 > Subject: Re: Cool feature I didn't know about > > Also, it's nifty to do this in your SQL query and avoid the overhead in CF > entirely, so long as your query is returning the desired rows. In MySQL > it > would be something like > > <cfquery name="getData"> > SELECT SUM(rev) AS revsum, MAX(rev) AS revmax, MIN(rev) AS revmin, > othercolumns FROM table WHERE whereclause > </cfquery> > > Then on your cf page, #getData.revsum#, #getData.revmax#, #getData.revmin# > will give you the desired output. > > -- Josh > > > > > ----- Original Message ----- > From: "Peterson, Chris" <[EMAIL PROTECTED]> > To: "CF-Talk" <[email protected]> > Sent: Tuesday, July 25, 2006 11:34 AM > Subject: Cool feature I didn't know about > > > > Most of you probably know this, but I thought I would share because I > > will use this all the time. > > > > How often do you need to output a total line at the bottom of a report? > > You probably do one of 2 things: 1) Increment a variable while > > outputting your query, or b) perform a query of queries. > > > > I found this trolling online and needed to share, lets say you have a > > query called 'getData' and a column named 'rev' and you needed a total. > > Just do this: #arraySum(getData['rev'])# You can use any array > > functions (avg, max, min) against a query column referenced like this. > > This seems a lot easier to read to me too! > > > > Chris Peterson > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:247663 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

