Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Performance of REGEXP_LIKE vs LIKE?
On 2007-04-19, Thomas Kellerer <JUAXQOSZFGQQ_at_spammotel.com> wrote:
> On 18.04.2007 22:52 zstringer999_at_gmail.com wrote:
>> The regular expression syntax is cleaner, especially when you have a
>> lot of strings to search for! However, the LIKE expression runs in 20
>> seconds, while the REGEXP_LIKE one runs in 60 seconds. Has anyone
>> else noticed this? Any way to speed it up?
>>
>
> I thought you should be able to create a function based index to support
> the regex match but I'm not sure (could have been Postgres where I did
> that the last time ;) )
You can't, at least on 10g XE:
SQL> create table foo_bar_t (a number, b varchar2(20));
Table created.
SQL> create index foo_bar_i1 on foo_bar_t (upper(b));
Index created.
SQL> create index foo_bar_i2 on foo_bar_t(regexp_like(b, '^[[:digit:]]+$')); create index foo_bar_i2 on foo_bar_t(regexp_like(b, '^[[:digit:]]+$'))
*
Maybe, I am missing something, then please let me know.
Cheers, RenÚ
-- Rene Nyffenegger http://www.adp-gmbh.chReceived on Fri Apr 20 2007 - 01:52:57 CDT