Skip to Content
0
Dec 15, 2006 at 09:00 AM

which Inner join will give better performance?

32 Views

Hi,

Here i posted two queries one with nested inner join or flat.

out of this two quries which one will give better performance?

<b>1)flat iiner join:</b>

select

a~col1

b~col2

c~col3

from ( table1 as a

INNER JOIN table2 as b on bcol2 = acol1

INNER JOIN tabke3 as c on ccol3 = acol1 )

into corresponding fields of table lt_tab

where

a~col11 = 'AB' AND

b~col22 = 'CD' AND

c~col33 = 'EF'.

<b>2) with nested inner join:</b>

select

a~col1

b~col2

c~col3

from ( ( table1 as a

INNER JOIN table2 as b on bcol2 = acol1 )

INNER JOIN tabke3 as c on ccol3 = acol1 )

into corresponding fields of table lt_tab

where

a~col11 = 'AB' AND

b~col22 = 'CD' AND

c~col33 = 'EF'.

Note: Table1 is index using col11 ( 200,000 enteries )

Table2 ( 50,000 enteries )

Table3 is index using col3 ( 200,000 enteries )

Please explain the reason?

Regards,

Prakash.