Of Interest
Business Intelligence and Analytics
Oracle Training
|
Oracle
»
PL-SQL
»
Performance
»
Index
Forcing an index with a hint
We've found the optimizer to be quite inconsistent in the way it chooses indexes;
a hint or two usually does the trick. Note that Oracle will NOT show an error if there
is a syntax error in the hint itself!
-- Force use of index on t1
select /*+ index (t1 idx_invoice1) */
t1.invoice_id,
t1.invoice_dt,
t1.amount
t2.comments
from invoice t1, invoice_detail t2
where t2.invoice_id = t1.invoice_id ;
|
|
|
Get the latest Rocket99 news and tech tips via
|