Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.
Moderators: Kalicharan, Moderator Group
Joined: Tue Oct 28, 2014 2:28 pm
I have a query which takes more time for execution and which leads to my program run for a longer time.
SELECT DISTINCT T3.FILEDV1,T3.FILEDV2,T3.FIELDV3,T3.FIELDV4,
FROM OPR63_MTABLE1 T3,
AND T3.LEDREC = '42'
AND T3.DATEID1 IN (T9.DATEID1, T2.DATEID1) <-- this line causing performance issue
in the query,
AND T3.DATEID1 IN (T9.DATEID1, T2.DATEID1)
this line causes the issue and take more time for processing. when code like
AND T3.DATEID1 IN (T2.DATEID1)
AND T3.DATEID1 IN (T2.DATEID1),
processing time is less than a sec.
could you guide me how I can improve this query.
Joined: Mon Oct 02, 2006 8:31 pm
have you tried:
and ( (t3.dateid1 in t9.dateid1) or (t3.dateid1 in t2.dateid1) )
and ( (t3.dateid1 in t2.dateid1) or (t3.dateid1 in t9.dateid1) )
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
Mainframe Interview questions
Mainframe Tools and others