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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: performance issue on this sql ???

Re: performance issue on this sql ???

From: Raymond Lee Meng Hong <RAYMOND_at_infopro.com.my>
Date: Tue, 23 Oct 2001 02:01:35 -0700
Message-ID: <F001.003B1F69.20011023020023@fatcity.com>

 I need to get the adue_cd and group by the sum of the adue_amt- amtpd based on the decoded code ??

  SELECT DECODE(adue_cd,'DS','STM','IS','INS','MS','OUI',    'PA','OD1','PN','OD2','PP','OD1')
   ,SUM(adue_amt - amt_pd)
   FROM BSADUE
   WHERE la_no = v_la_no
   AND adue_cd IN ('DS','IS','MS','PA','PN','PP')    GROUP BY adue_cd
   order by DECODE(adue_cd,'DS','STM','IS','INS','MS','OUI',    'PA','OD1','PN','OD2','PP','OD1')

here is my explain plan generate from TOAD.

Operation Object Name Rows Bytes Cost TQ In/Out PStart PStop

SELECT STATEMENT   SORT ORDER BY     SORT GROUP BY

      TABLE ACCESS BY INDEX ROWID       BSADUE
INDEX RANGE SCAN        BSADUE_LANO


Raymond Lee
Infopro Sdn Bhd

"Do not criticize someone until you walked a mile in their shoes, that way when you criticize them, you are a mile a way and have their shoes."

--

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

Author: Raymond Lee Meng Hong
  INET: RAYMOND_at_infopro.com.my

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Oct 23 2001 - 04:01:35 CDT

Original text of this message

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