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

Efficiency: "Inner join" vs "2 Select queries


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhushan.shete

New User


Joined: 14 Nov 2006
Posts: 17

PostPosted: Mon Jun 27, 2011 1:23 pm
Reply with quote

Hi All,

I have 2 tables say EMP and EMPATTRIB, both have primary key as EMPNO.

In COBOL program, i want to access couple of columns from each of these tables having one to one relationship.

Which of below option is efficient?
1) Using inner join on these 2 tables, so sql request will be once.
2) Using 2 different select queries one after another, join overhead will be reduced.

Both tables are indexed on EMPNO, each table have 30 Million rows.

I tried to search in forum, but could not found similar problem. Any pointers to findout which one is efficient would be also helpful.

Thank you
Bhushan
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Mon Jun 27, 2011 1:35 pm
Reply with quote

For me the first option is more efficient.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jun 27, 2011 9:12 pm
Reply with quote

Hello,

How did you determine this?
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts FINDREP before JOIN DFSORT/ICETOOL 3
No new posts DFSORT Join Keys Controlcard DFSORT/ICETOOL 4
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Inserting into table while open selec... DB2 1
Search our Forums:


Back to Top