Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: index usage
Richard Foote wrote:
> >> I can easily give you an example where an index is most efficient
when
> >> reading 0% of data
> >
> > snip all the rest of the good stuff to say
> >
> > 1. welcome back. and
>
> Hi Niall
>
> Thank you
>
> > 2. er, wouldnt not executing the query at all be more efficient in
the 0%
> > case?
> >
>
> Possibly but then how can you determine that there are no space seats
left
> on flight Q123 from Canberra to Brisbane on Jan 26 2005 without first
> querying the database and selecting no rows ...
>
> An index is the perfect way to select no rows (btw, Oracle uses them
all the
> time to do the same thing when validating a value in a unique
constraint).
Ah. at the risk of driving you away again you referred to *reading* 0% of the data rather than *returning* 0% of the data - it was an attempt at pedant humour, albeit with the serious point that apps often query databases for data they already know, I'd promise not to do it again but I fear that would be a broken promise.
What I want is a seat from Heathrow to Pretoria for England winning the test series on tuesday - for GBP1. In this case I really don't need to read the relevant table - I know that there will be an empty resultset :(.
Niall Received on Fri Jan 21 2005 - 10:13:25 CST
![]() |
![]() |