Re: Oracle strace output - detail
Date: Fri, 13 Jan 2012 07:29:35 +0100
Message-ID: <20120113062935.GA6162_at_app01.bos>
Hi,
On Thu, Jan 12, 2012 at 11:11:22PM +0000, Herring Dave - dherri wrote:
> Thanks for the additions, Phil. Do you have rules to follow for making REGEXP_* matches optimal? That kind of information is what I was looking for. I don't claim detailed knowledge of regular expression workings, so perhaps you could explain why:
>
> regexp_like(index_name,'^.*(COL)+.*$')
This regexp has a begin (^) and an end ($) tag. So the regexp library has a lot information where (and how) to look. Always start at the first character and end on the last one. The second regexp_like can start and end everywhere in the string.
>
> ... is 7 to 8 times faster than:
>
> regexp_like(index_name,'.*COL.*')
>
> Is it because without a beginning-of-line anchor the parser doesn't know where to start searching for the pattern, so possibly it acts "greedy" whereas by default I believe REGEXP_* functions in Oracle are "lazy"?
hmmm...you have the same opinion allready :-)
Best Regards,
Martijn Bos
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Jan 13 2012 - 00:29:35 CST