Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ADVICE NEEDED - Striping? SQL? Speed
Are you using index? One problem with yours, however, is that if the mask
in the LIKE operator begins with a percent sign or an underscore character,
the index cannot be used. Also in some cases, Oracle will not use an index
if the condition in the WHERE clause contains the OR operator.
Looking at your SQL statement below, I see three things that are slowing
down your query.
I don't know if you will be able to change your SQL statement so that it can avoid at least some cases of the above. If you can, it will make the statement go a lot faster.
>
>
> SELECT Field2,Field3,Field4,Field5 FROM Table1 WHERE
> (
> (
> (Field3 LIKE '%string[0]%') OR
> (Field4 LIKE '%string[0]%') OR
> (Field5 LIKE '%string[0]%')
> )
> AND
> (
> (Field3 LIKE '%string[1]%') OR
> (Field4 LIKE '%string[1]%') OR
> (Field5 LIKE '%string[1]%')
> )
>
> AND
> (
> (Field3 LIKE '%string[2]%') OR
> (Field4 LIKE '%string[2]%') OR
> (Field5 LIKE '%string[2]%')
> )
>
>
> ) ORDER BY Field5
>
Received on Thu May 20 1999 - 20:51:44 CDT
![]() |
![]() |