Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Index access vs Ignored hints
I have a question on some information that has been passed on similar
threads. Specifically concerning the possibility that Oracle would
never ignore a hint, if it can be used.
(I though that a hint was never guaranteed to be followed)
We have a rather large table (millions of rows), and one of the
function typically has to work on a very small set of rows (few
hundreds), and once in a while, several thousands. The function will
select a block of rows to be processed based on a status column, where
an ID column has the lowest value. The processing of the records is
important for this business function.
To get the blocks of ids, we currently use something like;
Select col_id
from (select col_id from TAB where col_status='D'
order by col_id)
where rownum < 101;
Since we currently have an index TAB_STATUS_ID_IDX
on TAB (col_status, col_id)
could we use the following select statement instead
Select /*+ INDEX (TAB TAB_STATUS_ID_IDX) */ col_id
from TAB
where col_status='D' and rownum < 101;
and be guaranteed the same result ?
(meaning that we would always get the lowest col_id, of ALL rows in
table TAB where col_status='D')
TIA Received on Tue Feb 15 2005 - 11:35:27 CST