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: 1530
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: 1638
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
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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