Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> help me win this "group by" argument

help me win this "group by" argument

From: <babette.turnerunderwood_at_hrdc-drhc.gc.ca>
Date: Tue, 23 Mar 2004 15:32:00 -0500
Message-ID: <FCF2E0B5B7A9CC4EAAD504CE0D2BB5B365DB5F@NCEV02.hrdc-drhc.net>

Two co-workers and I were discussing the mechanism that Oracle uses to do group by and whether sorts were required or not.

My understanding is the intermediate result set is sorted and whether the source data has be sorted or not depends on the type of group by function being applied. If it is a SUM or a COUNT, Oracle just increments the values. But if it is an average then Oracle sorts the original data into the group by values and then does the calculations.

Co-worker one says that Oracle always just increments the counts and for a AVG it will just be incrementing the SUM and COUNT and then use those for AVG.

Co-worker two says Oracle always sorts the data by the group by value and then applies the function..

So who's right ?

Thanks



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Tue Mar 23 2004 - 15:42:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US