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: ADVICE NEEDED - Striping? SQL? Speed

Re: ADVICE NEEDED - Striping? SQL? Speed

From: Ikro Yoon <ikro_at_nwu.edu>
Date: Thu, 20 May 1999 20:51:44 -0500
Message-ID: <7i2eab$7ml@news.acns.nwu.edu>


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.

  1. Extensive use of OR and AND.
  2. LIKE
  3. Your select statement is too big.

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

Original text of this message

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