Re: Pathological regexp match - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Pathological regexp match
Date
Msg-id 9837222c1002080515v5fee82baid8e88e9be0b457d4@mail.gmail.com
Whole thread Raw
In response to Re: Pathological regexp match  (Michael Glaesemann <michael.glaesemann@myyearbook.com>)
Responses Re: Pathological regexp match  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers
2010/2/1 Michael Glaesemann <michael.glaesemann@myyearbook.com>:
>
> On Jan 31, 2010, at 22:14 , Tom Lane wrote:
>
>> The Tcl folk accepted that patch, so I went ahead and applied it to
>> our code.  It would still be a good idea for us to do any testing we
>> can on it, though.
>
> I applied the patch and ran both the test query I submitted as well as original problematic query that triggered the
report,and it runs much faster. Thanks for the fix! 

I did the same, and it does not help in my case. FWIW, the regexp I'm
matching is:
<pre .*?>(.*?)</pre>

(yes, the production system has already been fixed to use a smarter
regexp that solves the same problem)

The text is about 180Kb. PostgreSQL takes ~40 seconds without the
patch, ~36 seconds with it, to extract the match from it. Perl takes
0.016 seconds.

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Bugs in b-tree dead page removal
Next
From: Alvaro Herrera
Date:
Subject: Re: Largeobject Access Controls (r2460)