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
 

 

Efficiency: "Inner join" vs "2 Select queries

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Efficiency: "Inner join" vs "2 Select queries
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Mon Jun 27, 2011 9:12 pm    Post subject:
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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Need help with below queries ashek15 DB2 3 Thu Mar 23, 2017 1:38 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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