Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Index problem with Oracle 8.0.5

Re: Index problem with Oracle 8.0.5

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Sat, 19 Oct 2002 01:38:24 GMT
Message-ID: <kI2s9.3221$Hj7.920@rwcrnsc53>


No. Never rely on the order of an unordered result set. Don't assume that if you create an index and do a select on the table without an order by that you will get the data in a particular order. You might, but you might not. You are not guaranteed and at some future time Oracle (and any other commercial quality RDBMS) may decide to get the data for you in some other order. And that behavior would be perfectly correct. Why? Your statement did not have an order by. AFAIK, if you read the ansi standard the results are unspecified as to the order of the data if you do NOT specify what order you desire by the order by. Don;t rely on a Hint giving it to you in a particular order. A hint is a hint and not a commandment. If you want the data in a particular order then use the order by clause. If you want Oracle to be more efficient in its use of an index then you will have to upgrade to 8.1.6 (maybe 8.1.5) or later. Then it actually creates an index in the order you stated (eg desc) instead of being compatible with the DDL command to do so.
Jim

"Ziegler thomas" <tz_at_operon.fr> wrote in message news:newscache$4zw64h$yz8$1_at_news.tiscali.fr...
> Thanx for your reply .
>
> It is exactely what I'm doing .
> The problem is that I need data in descending order but I would like to
> access to my records without adding the 'Order by ' statement which is a
> very heavy process on a large amount of data .
> I have created an Index on the column I'm using for the order by but the
> option DESC on the column name of the Index seems to be ignored at
creation.
> So if I want to have my data sorted in descending order I have two options
:
> the 'order by' statement in my request or the creation of an Index in
> descending order .(that's what I think ....)
> Maybe I'm completely wrong ... I admit I don't know Oracle and the use of
> Indexes so much ...
>
>
>
> "marc parkinson" <marcpark_at_starband.net> a écrit dans le message news:
> 2fKr9.5064$Df.2387243056_at_twister1.starband.net...
> > You do not create an index in assending or descending order.
> > The order of the query is based on an ORDER BY clause.
> > The order by clause can have the desc at the end of it.
> >
> > Example
> >
> > Secect my_col
> > FROM my_table
> > where my_col like 'super%'
> > order by my_col desc;
> >
> > Marc Parkinson
> > Senior Oracle Engineer
> >
> > "Ziegler thomas" <tz_at_operon.fr> wrote in message
> > news:aok6nv$233$1_at_news2adm.tiscali.fr...
> > > Hi,
> > >
> > > Is it possible to create an index in Descending order in Oracle 8.0.5
?
> > > I've tried to add the keyword DESC after the column name but it seems
to
> > be
> > > ignored .
> > > Here is what I tried :
> > > CREATE INDEX Myindex ON MyTable (MyColumn DESC) ....
> > >
> > > Thanx,
> > > Thomas.
> > >
> > >
> > >
> >
> >
> >
>
>
Received on Fri Oct 18 2002 - 20:38:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US