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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


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