Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generally when does optimizer use nested loop and Hash joins ?

Ken_73Jun 11 2013 — edited Jun 12 2013

Version: 11.2.0.3, 10.2

Lets say I have a table called ORDER and ORDER_DETAIL.

ORDER_DETAIL is the child table of ORDERS .

This is what I understand about Nested Loop:

When we join ORDER AND ORDER_DETAIL tables oracle will form a 'nested loop' in which for each order_ID in ORDER table (outer loop), oracle will look for corresponding multiple ORDER_IDs in the ORDER_DETAIL table.

Is nested loop used when the driving table (ORDER in this case) is smaller than the child table (ORDER_DETAIL) ?

Is nested loop more likely to use Indexes in general ?

How will these two tables be joined using Hash joins ?

When is it ideal to use hash joins  ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2013
Added on Jun 11 2013
2 comments
2,078 views