Home » SQL & PL/SQL » SQL & PL/SQL » like queries
like queries [message #20997] Fri, 05 July 2002 05:39 Go to next message
Jez
Messages: 6
Registered: July 2002
Junior Member
We have a lot of queries of the type

Select ... where col1 like '%search text%';

Which causes full table scans. Does anyone know how I can make it use an index.

thanks
Jez
Re: like queries [message #21010 is a reply to message #20997] Fri, 05 July 2002 21:48 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Since you are looking for a word or phrase in the middle of a column, Oracle Text (interMedia) is your best option here. Once you have created a special type of index on this column, it will be used and will avoid a full-table scan. Your query would then look like:

where col1 contains('search text') > 0
Previous Topic: subquery: how to make non-correlated
Next Topic: Tunning a SQL statement
Goto Forum:
  


Current Time: Thu Apr 25 09:50:15 CDT 2024