|
|
| Author |
Message |
krish_mrt
New User
Joined: 15 Apr 2005 Posts: 13 Location: Chennai
|
|
|
|
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 |
|
 |
References
|
Posted: Fri May 13, 2005 9:17 pm Post subject: Re: Using INNER JOIN.... in DB2 for iseries V5R3 |
 |
|
|
 |
ajay_dheepak
New User
Joined: 12 May 2005 Posts: 33 Location: Chennai
|
|
|
|
I believe its Option-2. Because first the join is made and then the where clause is executed.  |
|
| Back to top |
|
 |
|
|