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

Home -> Community -> Usenet -> c.d.o.server -> Re: Descending Indexes

Re: Descending Indexes

From: Greg Stark <greg-spare-1_at_mit.edu>
Date: Mon, 07 Feb 2000 05:53:20 GMT
Message-ID: <87emapy2wn.fsf@HSE-Montreal-ppp33976.qc.sympatico.ca>

Ritu <ritub_at_teri.res.in> writes:

> I have struggled so much but couldn't find a way to create desceding
> indexes using Oracle8 and Delphi4. My problem is that I want to display
> dates in descending order and also at the same time give the facility to
> update them so cannot use queries and views don't allow order by clause.

Hm, a possibility just occurred to me, I don't know if it will work:

create view backwards as (
 select /*+ index_desc(tbl,idx) */ * from tbl  )

Should ask Oracle to do a descending index scan on table "tbl". If Delphi isn't putting an ORDER BY clause on the query at all then this might work. A hint will not force Oracle to do something that doesn't satisfy the query though so if Delphi is putting an ORDER BY clause on the query it would force Oracle to ignore the hint in the view. Hints in views seem to be particularly unreliable in general however, probably something to do with the optimizer merging views, so I don't know if this will always work anyways.

--
greg Received on Sun Feb 06 2000 - 23:53:20 CST

Original text of this message

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