Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Forcing use of an index
Bob P wrote:
> I tried the query without the leading % with some data I knew was there
> and good. the query went from 11 seconds to .013 second. Since I have
> to do several thosand of these at a time against a table with a million
> + rows speed is important.
>
Not good enough - you only retrieved a very small portion of
your data.
You did not get xyz5443733996723, just to name one of the zillion
you kissed out on!
If the issue is that %7339% is issued where a 7339% should have been issued, then remove the leading %.
You did mention it was the user's request to have it there,
so the *user* is caught - either speed, of silly requirements
are being honoured.
Usually, one scans the query input for wildcards (% and _), and
rejects the query, if wildcards are found in the first x characters;
x varies, I've seen x in [1,2,3]
-- Regards, Frank van BortelReceived on Thu Mar 17 2005 - 08:21:04 CST
![]() |
![]() |