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: 19244
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts SELECT from data change table DB2 5
Search our Forums:

Back to Top