Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> USE_MERGE hint and the correct way to hint
Here is the query:
SELECT *
FROM acc, cus_acc
WHERE acc_id = id
AND
acc_id in (1,2,3....100 values)
GROUP BY acc_id
If I use the hint USE_MERGE(acc cus_acc) I get the desired execution plan below.
|* 5 | INDEX RANGE SCAN | PK_ACC | 50
| | 3 |
|* 6 | SORT JOIN | | 257 | 2827 | 20 |
| 7 | INLIST ITERATOR | |
| | |
|* 8 | INDEX RANGE SCAN | PK_CUS_ACC | 257 | 2827 | 4 | -------------------------------------------------------------------------------------------
I've heard the correct way to hint is use two hints per table, so I am wondering if I need to use additional hints to be more specific. Should I hint /*+ ORDERED USE_MERGE(acc cus_acc) */?
I played around with changing the order of the tables in the FROM clause and in the use_merge hint. It does change the order in the plan, but the logical reads come to the same.
-- Arul -- http://www.freelists.org/webpage/oracle-lReceived on Wed Feb 07 2007 - 13:51:51 CST
![]() |
![]() |