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: How to search on a column without using LIKE?

Re: How to search on a column without using LIKE?

From: Dan Clamage <clamage_at_mime.dw.lucent.com>
Date: 1997/09/26
Message-ID: <01bcca50$5501b160$54110b87@clamagent>#1/1

> The use of a function, like instr(), disallows the use of an index on
> org_name - resulting in a table scan.

Unless you offer the optimizer a HINT to use a particular index. SELECT /*+ INDEX (TABLE_NAME INDEX_NAME) */   *
FROM TABLE_NAME
WHERE
  instr( org_name, 'stans' ) > 0
  instr( org_name, 'widgets' ) > 0;

Note that if you specify an alias for the table, use the alias in the hint. Then verify the optimizer uses the index by running an EXPLAIN PLAN.

Received on Fri Sep 26 1997 - 00:00:00 CDT

Original text of this message

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