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


     
 
MAINFRAME - TIP OF THE DAY : Use TSO HOMETEST to find the Mainfram IP. This IP Address can be used with FTP GET , to unload files from mainframe.

Google
 
Web mainframegurukul.com

Programmers Voted for below topics.      Please Vote for good Posts. Votes Salutes
Topic Title Votes Salutes
SOC 7 abend - interview question 6
splitting of records using cobol 6
HOW TO FIND LINKAGE LENGTH 5
jcl sort to add leading zeroes 5
EJECT Verb in COBOL 4
Changes in copybook 4
Infosys Training Program for freshers 4
Comparing two files 3
What are the issues related with correlated subqueries? 3
VSAM File status 23 ,but records are present in the file 3
what is index or subscript in cobol. please give me brief ex 3
IKJ56500I COMMAND DSN NOT FOUND 3
Cobol Multiple Choice Questions By Shravan Wipro 1 1
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 1 1
What is the difference between SYNONYM and ALIAS? 1 1
sort two files with same sort condition 1 1
Merging two files into one based on certain key fields: 1 1
Copy GDG to GDG (one to one). 1 1
jcl sort to add leading zeroes 5
VSAM File status 23 ,but records are present in the file 3
How we can access PDS and its Members thru COBOL ? 3
stored procedure in cobol 2
what s the difference between DB2 & ADB2? 2
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 2
What is auditing? 2
Reg DFSORT utility. 2
Computer based tutorial on IMS DB/DC 2
what is index or subscript in cobol. please give me brief ex 2
How to compare two ps files having millions of records ? 2
SOC 7 abend - interview question 1
What is the difference between Static and Dynamic Binding? 1
How to read HEX file and convert it into decimal in REXX. 1
EZtrv+ - Is there a way to suppress ez-code from printing... 1
sort two files with same sort condition 1
U4093 IMS Abend 1
Is it possible to get last modified date of PDS members... 1
Merging two files into one based on certain key fields: 1
Corresponding statement 1
Comparing Date with current date 1
Man of the year 1
I need to FTP from MF to UNIX 1
DB2 PERFORMANCE TUNING TIPS

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


Joined: 27 Jan 2006
Posts: 1043

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 20, 2006 3:11 pm    Post subject: DB2 PERFORMANCE TUNING TIPS Reply with quote

DB2 PERFORMANCE TUNING TIPS

This thread is dedicated to discussion on DB2 PERFORMANCE TUNNING TIPS.
I am requesting members of this board to post performane tuning tips here.

Regards,
Krishna
www.geocities.com/srcsinc
www.ibmmainframeguru.com
www.jacharya.com
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

kumar_log@hotmail.com
Member


Joined: 28 Jan 2009
Posts: 6
Location: Singapore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jan 28, 2009 7:49 pm    Post subject: Reply with quote

Hi,

Please help me in my below DB2 query to run faster. Currently it is taking around 1 hour to complete.

SELECT A.C_AC_ID_C
,A.C_N
,A.C_AC_PRNT_ID_C
,A.C_AC_EF_D
,E.OFCE_ID_C
,B.DOC_RQR_D
,B.DOC_TYP_C
,C.DOC_TYP_T
,D.INTL_ID_C
,E.DEPT_ID_C
,B.DOC_STAT_TYP_C

FROM CAC.TC_AC_COMBD A,
CAC.TDOC_STAT B,
CAC.TDOC_REF C,
CAC.TC_AC_INTL_ID_XREF D,
PRD.TSR_OLD_ID E
WHERE A.C_AC_T_ACTY_STAT_I = ' ' AND
A.C_AC_EF_D > 20011004 AND
A.C_AC_ID_C = B.C_AC_ID_C AND

((B.DOC_STAT_TYP_C = 'R' AND
B.DOC_TYP_C = C.DOC_TYP_C AND
B.DOC_TYP_C IN ('01', '02', 'PAR'))
OR
(B.DOC_STAT_TYP_C = 'R' AND
A.C_AC_ID_C BETWEEN '7 ' AND '799999' AND
B.DOC_TYP_C NOT IN ('ACAP', 'OBFN', 'PAR', 'QB',
'Q13', 'RA', 'TAOP', '03', '10',
'14', '38', '45', '77', '8BEN',
'94', '95') AND
B.DOC_TYP_C = C.DOC_TYP_C)
OR
(B.DOC_STAT_TYP_C = 'F' AND
B.DOC_TYP_C = C.DOC_TYP_C AND
B.DOC_TYP_C = 'PAC')) AND

(A.C_AC_ID_C = D.C_AC_ID_C AND
D.INTL_ID_TYP_C = 'L1') AND
SUBSTR(D.INTL_ID_C,1,6) = E.SR_OLD_ID_C AND
E.EM_GRP_C = 'E'

ORDER BY E.OFCE_ID_C, E.DEPT_ID_C, D.INTL_ID_C,
A.C_AC_ID_C, B.DOC_TYP_C




One more similar query is there

SELECT A.C_AC_ID_C
,A.C_N
,A.C_AC_PRNT_ID_C
,A.C_AC_EF_D
,E.OFCE_ID_C
,B.DOC_RQR_D
,B.DOC_TYP_C
,C.DOC_TYP_T
,A.SR_PRIM_ID_C
,E.DEPT_ID_C
,B.DOC_STAT_TYP_C

FROM CAC.TC_AC_COMBD A,
CAC.TDOC_STAT B,
CAC.TDOC_REF C,
PRD.TSR_OLD_ID E

WHERE A.C_AC_T_ACTY_STAT_I = ' '
AND A.C_AC_EF_D > 20020606
AND A.C_AC_ID_C = B.C_AC_ID_C

AND ((B.DOC_STAT_TYP_C = 'R'
AND B.DOC_TYP_C IN ('01', '02', 'PAR'))
OR
(B.DOC_STAT_TYP_C = 'R'
AND A.C_AC_ID_C BETWEEN '7 ' AND '799999'
AND B.DOC_TYP_C NOT IN ('ACAP', 'OBFN', 'PAR', 'QB',
'Q13', 'RA', 'TAOP', '03',
'10', '14', '38', '45', '77',
'8BEN', '94', '95'))
OR
(B.DOC_STAT_TYP_C = 'F'
AND B.DOC_TYP_C = 'PAC'))

AND B.DOC_TYP_C = C.DOC_TYP_C
AND E.SR_OLD_ID_C = A.SR_PRIM_ID_C
ORDER BY E.OFCE_ID_C,
E.DEPT_ID_C,
A.SR_PRIM_ID_C,
A.C_AC_ID_C,
B.DOC_TYP_C



Please help me out to run faster. What kind of performance tuning process can be done.
_________________
Thanks and Regards,
L.Kumar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jan 29, 2009 10:31 am    Post subject: db2 performance tuning tips Reply with quote

Hi,

welcome to mainframegurukul.com.

My suggestions to improve above queries are :

1. Define index on the fields used in Where clause.
2. some of the comparisons can be done after fetching the record.
i.e., instead having those many conditions in WHERE clause
code important conditions in query. rest of the conditions , you
can code in application program, after fetching the record.





Suggestion: Please dont reply to the existing thread for new questions.
Please start a new topic by clicking "POST" button.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
kumar_log@hotmail.com
Member


Joined: 28 Jan 2009
Posts: 6
Location: Singapore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Feb 13, 2009 12:00 am    Post subject: Re: db2 performance tuning tips Reply with quote

Thanks for the response. It works for me.
_________________
Thanks and Regards,
L.Kumar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 09, 2009 2:43 pm    Post subject: Reply with quote

DB2 V8 feature multi-row FETCH reduce 50% CPU time. You can observe good CPU time reduction, if you are fetching more records.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 09, 2009 2:44 pm    Post subject: Reply with quote

Testing has shown up to a 40% CPU time reduction when using multi-row INSERT
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
kumar_log@hotmail.com
Member


Joined: 28 Jan 2009
Posts: 6
Location: Singapore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri May 08, 2009 7:26 pm    Post subject: Reply with quote

Hi Natarajan,

When i ran the above query as in SPUFI, it ran in 40 sec, rows retrieved was 2.
But when i ran the same query in COBOL program, it took 2+ hours to complete.

I'm planning to reduce down the "where" condition.
Do you have any further idea.
_________________
Thanks and Regards,
L.Kumar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sun May 10, 2009 8:08 am    Post subject: Reply with quote

That much time difference between SPUFI & COBOL wont be there.
Try using with UR at the end of the select in COBOL
Update your BIND card for proper locking mechanisms.

Yes. decreasing where clause will definitely will help in increasing performance.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
arunaa27
Member


Joined: 08 Jul 2009
Posts: 2
Location: Bloomington,IL,USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Aug 01, 2009 2:05 am    Post subject: Reply with quote

Hi,
You can consider the following for better performance in general aspects. I am posting this message even though it is not related to your question...

1) You can always use DISTINCT clause (unless your requeirement needs duplicate values).
2) Please avoid DB2 built-in functions like SUBSTR, RTRIM, etc in an non-indexed fields.

Thanks,
Arun
_________________
Arun
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
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 Sticky: MainframeTutorials.com 8 Krishna 20820 Sun Sep 19, 2010 9:36 am
Anuj Dhawan View latest post
No new posts why I choose sarkarionline.com 1 sarkariionline 456 Tue Jun 24, 2014 4:15 pm
Arslan230 View latest post
No new posts Welcome to ibmmainframeguru.com / mainframegurukul.com 1 Krishna 12750 Fri Jul 09, 2010 1:30 am
krmohankumar08 View latest post
No new posts I need a JCL to delete the last 6 lines of all the members i 3 osurendhra 14728 Tue Mar 30, 2010 1:39 pm
Anuj Dhawan View latest post
No new posts www.uscareerbank.com 0 prabakarank 6367 Mon Apr 27, 2009 2:59 pm
prabakarank View latest post
 





Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

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 || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

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

mainframetopic-1281.html