Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Will Index be Used - ORDER BY MYFIELD DESC?
In SqlPlus try:
Set autotrace ON
run the query each way( with and without the DESC ) and see which uses the index
delphidev2000_at_yahoo.com (Delphi Dev 2000) wrote:
>Will the index be used in the following scenario on Oracle 8i? I have
>browsed through the news groups and it appears that there is no clear
>answer to this. I have tried to do some speed benchmarks myself.
>Sometimes it seems that the query takes longer while other times it is
>quicker; I suspect that there may be some caching going on.
>
>In any event, can you traverse backwards on indexes that are not
>created with the "DESC" keyword?
>
>Create Index MYINDEX ON MYTABLE(MYFIELD);
>SELECT MYFIELD FROM MYTABLE WHERE MYFIELD <= 'XXXXXX' ORDER BY MYFIELD
>DESC;
>
>
>Thanks, Mark
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Thu Dec 20 2001 - 14:22:09 CST