View previous topic :: View next topic
|
Author |
Message |
raghavmcs
Active User
Joined: 14 Jul 2005 Posts: 105
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Try an EXPLAIN
Also using Join could reduce the number of DB2 calls |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
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 |
|
|
roopannamdhari Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 71 Location: Bangalore
|
|
|
|
Join consume more CPU.out of 2 option refer 2nd one .
Depending on requirement you can fine tune 2nd option |
|
Back to top |
|
|
roopannamdhari Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 71 Location: Bangalore
|
|
|
|
Join consume more CPU.out of 2 option refer 2nd one .
Depending on requirement you can fine tune 2nd option |
|
Back to top |
|
|
|