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 -> SQL statement optimization

SQL statement optimization

From: music4 <music4_at_163.net>
Date: Fri, 7 Nov 2003 10:40:47 +0800
Message-ID: <bof0na$rlg@netnews.proxy.lucent.com>


Greetings,

I have a table for subscriber information, and sub_number is primary key of VARCHAR(30) type. And I have query as following:

select * from table where sub_number like % || user_input || %;

For example, if there are sub_numbers: '12345678' and '23456789', by input '234', the query will return both sub_numbers.

But this query is extremely slow, and occupy too much CPU usage since it doesn't apply to index.

Is there a way to optimize such query?

Any idea will be greatly appreciated! Thanks in advance!

Evan Received on Thu Nov 06 2003 - 20:40:47 CST

Original text of this message

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