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

Using INNER JOIN.... in DB2 for iseries V5R3


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

New User


Joined: 15 Apr 2005
Posts: 12
Location: Chennai

PostPosted: Fri May 13, 2005 9:17 pm
Reply with quote

Hi!

pls suggest which of the two queries fetch result set faster.
option - 1
Code:
select tab1.a1,tab2.x2
from tab1,tab2
where tab1.a1 = 'aaa'
and tab1.a3 = tab2.x1


option - 2
Code:
select tab1.a1,tab2.x2
from tab1 inner join tab2
               on tab1.a3 = tab2.x1
where tab1.a1 = 'aaa'


Note:
1.index has been created on tab1(a1) and on tab2(x1)
2.row count of both the tables are 60,000+
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Thu May 19, 2005 5:26 pm
Reply with quote

I believe its Option-2. Because first the join is made and then the where clause is executed. icon_rolleyes.gif
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 ICBS on iSeries w/ MFA and SSO All Other Mainframe Topics 0
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 JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Join files where value in one is betw... DFSORT/ICETOOL 6
Search our Forums:

Back to Top