Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGsz6-0003aC-UY for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 16:29:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGsz6-0000ym-BZ for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2014 16:29:56 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGsz5-0000yd-23 for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 16:29:55 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGsz2-0007Rm-If for pgsql-hackers@postgresql.org; Fri, 21 Feb 2014 16:29:54 +0000 Received: from ayaki.localdomain ([123.63.112.150]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0Lu4P8-1XErJd15eg-011UY1; Fri, 21 Feb 2014 17:29:41 +0100 Message-ID: <53077EED.2000907@2ndquadrant.com> Date: Sat, 22 Feb 2014 00:29:33 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Florian Pflug CC: Pg Hackers , Sandro Santilli Subject: Re: Uninterruptable regexp_replace in 9.3.1 ? References: <20140221091759.GK6924@localhost> <530774E5.5040105@2ndquadrant.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Ro8Q1e7o6ZXEV7CYvPmCQUc9XciicuuoRl8kZnoh/QX T0OmTV1WcMMsUbLsNRXOwDqV3W4LwqjOuS7FdkpBgk8H0K6GXu eCSNOwYpgHxad7BSMFSh31LqqGEB7x/agtVtN8FBNbtl+EXcap kifPYvB3yxe3LOLYlBcs9yn/n/+JhRAkWUl+ZR4VlsAe9757+A K+SjQlWFFPfSmK0kT3pHDcayT8aU45hfqPGZg9XDt1vLhC5WOy Ol6GFEeFmsC53/r6PhDPAPz9i6prI9JiI3Ce89JWlSr+h9+Ms7 rZ7yceSmc7NdRT/bwABew3qMewtKShHVP2wRaY+og2I3+7AhAh 8iFrfuN0CFU+lIvf1bqq/Ddz9R7mKF/m47Dxyp/1W X-Pg-Spam-Score: -0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 02/22/2014 12:04 AM, Florian Pflug wrote: > On Feb21, 2014, at 16:46 , Craig Ringer wrote: >> The real question IMO is why it's taking so long. It looks like >> cfindloop(...) is being called multiple times, with each call taking a >> couple of seconds. > > Yeah, I wondered about this too. I've shortened the example a bit - here > are a few observations > > [snip] > > In other words, the observes runtime is roughly 2^i * 1.5^j for inputs > consiting of i leading spaces (any character will probably do) followed > by j substring of the form $X$ (X is an arbitrary character). The biggest change in regexp support in the introduction of proper unicode support, but that was before 9.1. The problem report claims that the issue does not occur on 9.1, but yet: git diff REL9_1_STABLE master -- ./src/backend/utils/adt/regexp.c is utterly trivial; a copyright date line change, and 1609797c which just tweaks the includes. 9.0 has a much bigger diff. So I'd like to confirm that this issue doesn't affect 9.1. I can reproduce the issue againts 9.2. I don't have 9.1 or older lying around to test against right this second. Sandro, can you please provide the output of "SELECT version()" from a PostgreSQL version that is not slow with this query? (BTW, I'm highly amused by how the development style has changed around here. From "git blame", this is from 1997: "I haven't actually measured the speed improvement, but it `looks' a lot quicker visually when watching regression test output." Ha.) -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers