arvind

arvind

  • NA
  • 0
  • 3.6k

Optimize performance of oracle select statement.

Aug 5 2015 1:58 AM
Can anybody guid me to optimize this oracle select statements. 
Is select statement for column INSTNAME, INSTADDRESS will reduce the performace? how to overcome if there is no matching column in main table. 
 
SELECT WDH.C_NAME AS CLIENTNAME,WCL.NAME AS LOCNAME,WCL.ADDRESS AS LOCADDRESS,WCL.PHONE AS LOCPHONE,LSC.NAME AS LOCCOUNTRY,
WDH.TRANCODE || WDH.DEALNO AS DEALREFNO,LST.TRANNAME AS TRANNAME, TO_CHAR(WDH.DEALBDATE,'DD-MON-YYYY') AS DEALDATE,
DEALERNAME, WDD.CURCODE ,NVL(WDN.DENOM,'MIXED') AS DENOM, WDN.QUANTITY,
WDD.TRLOCAMOUNT AS USDEQUIVALENT,
(CASE NVL(WDN.DENOM,'NODENOM') WHEN 'BULK' THEN WDN.QUANTITY WHEN 'MIXED' THEN WDN.QUANTITY WHEN 'NODENOM' THEN WDD.TRAMOUNT
ELSE (WDN.DENOM * WDN.QUANTITY) END) VALUE,
(SELECT NVL(NAME,' ') FROM ADM_INSTITUTIONS WHERE ID ='1') AS INSTNAME,
(SELECT NVL(ADDRESS,' ') FROM ADM_INSTITUTIONS WHERE ID ='1') AS INSTADDRESS,
FROM WCS_DEALHEADER WDH
LEFT OUTER JOIN WCS_DEALDETAILS WDD ON WDH.DEALNO = WDD.DEALNO
LEFT OUTER JOIN WCS_DEALDENOMS WDN ON WDD.DEALNO = WDN.DEALNO AND WDD.DEALSUBNO= WDN.SUBDEALNO
INNER JOIN WCS_LOCATIONS WCL ON WDH.CLIENTID = WCL.CLIENTID AND WDH.LOCATIONID = WCL.LOCATIONID
INNER JOIN ADM_USERS ADU ON WDH.DEALERID = ADU.ID
INNER JOIN LST_TRANSACTIONS LST ON WDH.TRANCODE= LST.TRANCODE
INNER JOIN LST_COUNTRIES LSC ON WCL.COUNTRY = LSC.CODE