INDEX_DESC Hint [message #364394] |
Mon, 08 December 2008 04:47 |
Olivia
Messages: 519 Registered: June 2008
|
Senior Member |
|
|
The INDEX_DESC hint instructs the optimizer to use a descending index scan for the specified table. If the statement uses an index range scan and the index is ascending, then Oracle scans the index entries in descending order of their indexed values. In a partitioned index, the results are in descending order within each partition. For a descending index, this hint effectively cancels out the descending order, resulting in a scan of the index entries in ascending order. Each parameter serves the same purpose as in "INDEX Hint". For example:
SELECT /*+ INDEX_DESC(e emp_name_ix) */ *
FROM employees e;
what will bethe difference if we use INDEX_DESC with the below query
SELECT /*+ INDEX_DESC(e emp_name_ix) */ *
FROM employees e order by emp_name desc;
Regards,
oli
|
|
|
|
|
|