PERFORMANCE TUNING.

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
ambilileela
Member
Posts: 11
Joined: Tue Jun 06, 2006 2:12 pm

PERFORMANCE TUNING.

Post by ambilileela » Mon Aug 07, 2006 4:36 pm

Hi all,

I have a query to be tuned for performance. The reason being its using a table ORDER_LI which is having huge volume of data. I am using the indexed columns only. But as I have a SUM function in the query i dont think it will help. Please provide me some pointers to improve the performance.

SELECT 'VSN' AS DTL_TYPE
, DL.OCCURENCE_NO AS DTL1
, DL.DEAL_NO AS DEAL
, CC.CUST_NO AS CUST_NO
, CC.CUST_NM AS CUST_NM
, CC.CUST_CITY_NM AS CITY_NM
, OL.ORIG_HIER_ID AS DTL2
, DL.PERF_OPT_CD AS DTL3
, OL.REP_SLS_ORGN_ID AS DTL4
, CHAR(VL.STRT_DT) AS DTL5
, CHAR(VL.END_DT) AS DTL6
, VL.SLS_CHNL_ID AS DTL7
, CHAR(VL.TOT_SPND_TO_DT_AMT) AS DTL8
, SUM(OL.SHIP_QT) AS QUANTITY
, SUM(DL.DEAL_DOL_AM) AS AMOUNT
FROM TESTQ.DEAL_LI DL
, TESTQ.ORDER_LI OL
, TESTQ.VSN_DEAL_LEVEL VL
, TESTQ.CUSTOMER_COMMON CC
WHERE DL.DEAL_NO = 'BA4Y'
AND DL.ORD_NO = OL.ORD_NO
AND DL.ORD_ITEM_NO = OL.ORD_ITEM_NO
AND OL.ORIG_CUST_NO = '1990663'
AND OL.ORIG_HIER_ID = '0C2'
AND OL.ORIG_CUST_NO = CC.CUST_NO
AND VL.OCCURENCE_NO = DL.OCCURENCE_NO
AND DL.SL_STS_IN IN('999','000')
AND VL.OCCURENCE_VERS_NO =
( SELECT MAX(VL1.OCCURENCE_VERS_NO)
FROM TESTQ.VSN_DEAL_LEVEL VL1
WHERE VL1.OCCURENCE_NO = VL.OCCURENCE_NO )
GROUP BY DL.OCCURENCE_NO
, DL.DEAL_NO
, CC.CUST_NO
, CC.CUST_NM
, CC.CUST_CITY_NM
, OL.ORIG_HIER_ID
, DL.PERF_OPT_CD
, OL.REP_SLS_ORGN_ID
, VL.STRT_DT
, VL.END_DT
, VL.SLS_CHNL_ID
, VL.TOT_SPND_TO_DT_AMT

Thanks In advance,
Ambili.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others