Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Using INNER JOIN.... in DB2 for iseries V5R3

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
krish_mrt

New User


Joined: 15 Apr 2005
Posts: 13
Location: Chennai

PostPosted: Fri May 13, 2005 9:17 pm    Post subject: Using INNER JOIN.... in DB2 for iseries V5R3
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
References
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 33
Location: Chennai

PostPosted: Thu May 19, 2005 5:26 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1