When I mean "bad index" I mean an index which has been left to fragment etc. You have to maintain indexes - simple creating them isn't job done.
What could take 2 seconds on a good DB could take 5 mins to run on a shitty index. "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 20:09:22 2006 Subject: Re: Cool feature I didn't know about Yup, that's true, the db must be in good shape...can you elaborate on what you mean by a bad index? How about if there is no index on the aggregated column, what are the consequences there? Trying to learn more about dbs. Also, forgot to mention that in MySQL at least, you'll need to use GROUP BY on a column if you are using an aggregate function such as SUM. -- Josh ----- Original Message ----- From: "Robertson-Ravo, Neil (RX)" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Tuesday, July 25, 2006 11:36 AM 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:247675 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

