Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 qn asked in i/v - How to reduce the execution time

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: DB2 qn asked in i/v - How to reduce the execution time
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

Site Director


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

PostPosted: Sun May 24, 2009 11:29 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon May 25, 2009 1:40 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm
No new posts Merging records, but not all the time prino DFSORT/ICETOOL 17 Sat Feb 17, 2018 4:20 pm
No new posts Need to identify top 10 costly or tim... ashek15 DB2 4 Wed Feb 14, 2018 3:20 am
No new posts Logic to skip Maximum time-stamp and ... vickey_dw DB2 2 Thu Feb 01, 2018 11:15 pm
No new posts Query to skip Max time-stamp and fetc... vickey_dw DB2 8 Sun Jan 28, 2018 1:09 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us