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

DB2 Join query Vs COBOL Code


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Mon Jun 16, 2014 5:33 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 2727
Location: NYC,USA

PostPosted: Tue Jun 17, 2014 12:32 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts JSON PARSE in Enterprise COBOL COBOL Programming 2
No new posts Cobol code- to find a string in a str... COBOL Programming 3
No new posts DB2: Need helping below DB2 query DB2 13
No new posts Is the Output of Sort/Join dependent ... DFSORT/ICETOOL 2
No new posts regarding COBOL WRITE verb (VB File H... COBOL Programming 6
Search our Forums:

Back to Top