Re: Using LIKE with indexed column

From: Barry Roomberg <barry_roomberg_at_iacnet.com>
Date: 1995/04/18
Message-ID: <D78Hsr.4ux_at_zcias2.ziff.com>#1/1


In article <1995Apr18.082719.17379_at_nosc.mil>, gtupper_at_avenger.nosc.mil (Greg Tupper) says:
>
>
>A Question on Indicies and Like
>
>Environment
>Hp 755
>Hpux 9.01
>Oracle 7
>
>
>I have a table (45,000+ records) with a varchar2 (60) not null column, col1, with a
>unique index built on it.
>
>When I select a record and specify a particular value for col1 ( ie select * from table1
>where col1 = 'howdy doody time') , I get an answer back in 0.01 seconds. Rather faster
>that I expected.
>
>When I select a record using like (ie select * from table1 where col1 like 'howdy doody
>tim%' ) I must wait 60 to 220 seconds for the answer, even though there is only one
>record in the table that will match.
>

Should be just as fast as the exact =. Sounds like an optimizer problem. Make sure you are using RULE based and not COST based (look into alter session and/or) init.ora params) and drop any statistics associated with that table and try again. Received on Tue Apr 18 1995 - 00:00:00 CEST

Original text of this message