Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


PERFORMANCE TUNING.

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 PROGRAMMING
  View previous topic :: View next topic  
Author Message
ambilileela
Member


Joined: 06 Jun 2006
Posts: 11

PostPosted: Mon Aug 07, 2006 4:36 pm    Post subject: PERFORMANCE TUNING. Reply with quote

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.
Back to top
View user's profile Send private message

Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 PROGRAMMING All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Sort file by groups, keeping only the last group 7 TamiAZ 1070 Fri Oct 02, 2009 11:24 am
TamiAZ View latest post
No new posts What do you accomplish by GROUP BY ... HAVING clause? 1 Krishna 1215 Sun Mar 29, 2009 10:13 pm
Krishna View latest post
No new posts United Health group Interview ? 0 need@help 2548 Fri Mar 06, 2009 12:43 am
need@help View latest post
No new posts can i write a elementary item to group item. 1 mainframe5 1492 Tue Jun 17, 2008 1:47 pm
dbzTHEdinosauer View latest post
No new posts Why is Group move better than INITIALIZE verb? 1 NiceGuy 2314 Mon Nov 19, 2007 6:52 am
DavidatK View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB