Author: Gunapala CN
Subject: What are the way we can improve CPU performance in DB2 qry
Posted: Mon Oct 24, 2016 2:16 pm (GMT 5.5)
Hi All,
i'm doing performance fix for old legacy system code, where one cursor has many sub queries and exists clauses.
i tried to replace that logic using icetool with minimum unload queries in jcls' but it not giving expected savings.
therefore i wanted to know is there anyway below query can be write different way.
regards,
Guna
_________________
Gunapala
Subject: What are the way we can improve CPU performance in DB2 qry
Posted: Mon Oct 24, 2016 2:16 pm (GMT 5.5)
Hi All,
i'm doing performance fix for old legacy system code, where one cursor has many sub queries and exists clauses.
i tried to replace that logic using icetool with minimum unload queries in jcls' but it not giving expected savings.
therefore i wanted to know is there anyway below query can be write different way.
Code: |
//UNLD.GUN EXEC ZPLNIMS,MBR=IKJEFT01,COND=(4,LT) //STEPLIB DD DSN=DB10.RUNLIB.LOAD,DISP=SHR //SYSTSIN DD * DSN SYSTEM(DB10) RUN PROGRAM(DSNTIAUL) PARMS('SQL') END //SYSIN DD * SELECT .GUN.CR_PART_NO , .GUN.RO_NO , .GUN.SG_CD , .GUN.BPR_TPN , .GUN.EXP_STEP_EFF_DT , .GUN.EXP_STEP_END_DT , .GUN.STEP_TYPE_NUM , .GUN.STEP_ID , BSC.STEP_CLASS , .GUN.STEP_UPLIFT_PC , VOL.STEP_VOLUME , BSC.UPLIFT_TYPE , BSC.MERGE_RULE , .GUN.RESOLVE_IND , .GUN.RESOLVE_ACTION_IND , .GUN.NORMAL_STEP_CF , .GUN.SHDW_STEP_CF , .GUN.WTHR_STEP_CF , .GUN.LAST_UPDT_TSTAMP , .GUN.STEP_REASON , .GUN.WTHR_SENS_FLAG , .GUN.CONTINUE_NWS FROM GDB2JJPL.VXJJ0BSC BSC, GDB2JJPL.VXJJ0.GUN .GUN LEFT OUTER JOIN GDB2JJPL.VXJJ0VOL VOL ON .GUN.CR_PART_NO = VOL.CR_PART_NO AND .GUN.RO_NO = VOL.RO_NO AND .GUN.BPR_TPN = VOL.BPR_TPN AND .GUN.STEP_ID = VOL.STEP_ID WHERE .GUN.CR_PART_NO // DD DSN=JKL.JKPARTNO.TEMP.CARD.P0A,DISP=SHR // DD * AND .GUN.EXP_STEP_END_DT // DD DSN=&&CARD2,DISP=(OLD,PASS) // DD * AND .GUN.LAST_UPDT_TSTAMP // DD DSN=&&CARD3,DISP=(OLD,PASS) // DD * AND .GUN.EXP_STEP_EFF_DT <= '9999-12-31' AND .GUN.STEP_TYPE_NUM = BSC.STEP_TYPE_NUM AND EXISTS (SELECT 1 FROM GDB2JJPL.VXJJ0XSU XSU WHERE XSU.CR_PART_NO = .GUN.CR_PART_NO AND XSU.RO_NO = .GUN.RO_NO AND SUBSTR(XSU.SG_CD,1,1) = SUBSTR(.GUN.SG_CD,1,1) ORDER BY 1,2,3,4,5,6 WITH UR; //SYSPUNCH DD DUMMY //SYSREC00 DD DSN=JKL.VXJJ0.GUN.UNLOAD.P0A,DISP=(,CATLG), // UNIT=DASD,SPACE=(CYL,(25,3),RLSE) //SYSTSPRT DD SYSOUT=* |
regards,
Guna
_________________
Gunapala