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: 1534
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: 1652
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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