Re: Pathological regexp match

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Glaesemann <michael(dot)glaesemann(at)myyearbook(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pathological regexp match
Date: 2010-02-08 13:15:32
Message-ID: 9837222c1002080515v5fee82baid8e88e9be0b457d4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/2/1 Michael Glaesemann <michael(dot)glaesemann(at)myyearbook(dot)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 Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-02-08 13:23:11 Re: Largeobject Access Controls (r2460)
Previous Message Heikki Linnakangas 2010-02-08 12:01:22 Re: Bugs in b-tree dead page removal