Descending Indexes Quiz (Up On The Ladder) September 8, 2011Posted by Richard Foote in Descending Indexes, Oracle Indexes, Quiz.
OK, you won’t find the answer to these questions on my blog, so using my search facility won’t be of any help🙂
Actually, it’s quite an easy one this, honest😉
If you have a query such as:
SELECT * FROM bowie WHERE id BETWEEN 42 and 84 ORDER BY id DESC;
1) Can a default B-Tree index on the single ID column that stores data in Ascending order be used by the CBO to retrieve the data automatically in the required Descending order, without the need for a sort operation ?
2) Can a Descending B-Tree index on the ID column be used by the CBO to retrieve the data automatically in Ascending order, without the need for a sort operation ?
3) Depending on your answers above, what are the differences (if any) between the implementation of an Ascending and Descending index ?