IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 qn asked in i/v - How to reduce the execution time


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Sun May 24, 2009 6:15 pm
Reply with quote

Q. Suppose there are 2 tables accessed in COBOL program. Records are fetched from first table and then on the bases of those records second table is read. Presently result set for first table contains of 2000 records only. After some time result set for first table grew to 8,000,000 and program started to take long time. How to reduce the execution time. One thing I can think of was using join on key, but i/v guy was looking for some other answer.

Also are there any FAQs avialable to learn complex sql queries.

Thanks,
Satish
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 24, 2009 11:29 pm
Reply with quote

Hello,

I believe more info is needed . . .

The simple answer is to process less rows somehow. . .

One way to reduce the number of rows processes might be to read the second table first and then read the associated table1 entries.

The question doesn't mention if all 8,000,000 rows are needed, just that they are in the result set. . .
Back to top
View user's profile Send private message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Mon May 25, 2009 12:09 am
Reply with quote

Hi,

you can seek DBA's help. Ask him to put index's on the column used in query and use index'ed column in where clause( search faster). If this is already there re-building indexes ,would be good ( again DBA).
As for REORG on the table etc.you can RE-BIND also.
But all this DBA stuff.

If we have the query in our hand..may query can be optmized too.

That's what i could think of.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 25, 2009 1:40 am
Reply with quote

Hello,

Quote:
you can seek DBA's help.
A good idea on the job, but i suspect that is not what the interviewer was looking for. . . icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top