Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Join query Vs COBOL Code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Mon Jun 16, 2014 4:25 pm    Post subject: DB2 Join query Vs COBOL Code
Reply with quote

I have a requirement, in that I have to extarct the data from 7 tables.

Here I have 2 options, I can write a DB2 Join query or write a COBOL program (First I will fetch the records from one table and then from the result of fisrt query need to fetch the data from 2nd table...so on till 7th table)

Perfromance wise which is better?

I am going to join the tables on indexed colmns only.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1531
Location: Andromeda Galaxy

PostPosted: Mon Jun 16, 2014 5:33 pm    Post subject:
Reply with quote

Try an EXPLAIN

Also using Join could reduce the number of DB2 calls
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1625
Location: NY,USA

PostPosted: Tue Jun 17, 2014 12:32 am    Post subject:
Reply with quote

1) You can go for the DB2 unload utilities
2) Or if you have the load files for these tables then use SORT JOINKEY's instead of DB2 ( Best in performance)
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Fri Jun 20, 2014 7:01 pm    Post subject:
Reply with quote

Join consume more CPU.out of 2 option refer 2nd one .

Depending on requirement you can fine tune 2nd option
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Fri Jun 20, 2014 7:01 pm    Post subject:
Reply with quote

Join consume more CPU.out of 2 option refer 2nd one .

Depending on requirement you can fine tune 2nd option
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us