pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@2ndquadrant.com>
To: Florian Pflug <fgp@phlo.org>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Sandro Santilli <strk@keybit.net>
Subject: Re: Uninterruptable regexp_replace in 9.3.1 ?
Date: Sat, 22 Feb 2014 00:29:33 +0800
Message-ID: <53077EED.2000907@2ndquadrant.com> (raw)
In-Reply-To: <D4594E29-6A28-43C0-BD33-FC3EE8A23683@phlo.org>
References: <20140221091759.GK6924@localhost>
	<530774E5.5040105@2ndquadrant.com>
	<D4594E29-6A28-43C0-BD33-FC3EE8A23683@phlo.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 02/22/2014 12:04 AM, Florian Pflug wrote:
> On Feb21, 2014, at 16:46 , Craig Ringer <craig@2ndquadrant.com> 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



view thread (9+ messages)  latest in thread

Message-ID: <53077EED.2000907@2ndquadrant.com>
Permalink:  ../53077EED.2000907@2ndquadrant.com/
Also on:    postgresql.org/message-id/53077EED.2000907@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: craig@2ndquadrant.com, fgp@phlo.org, pgsql-hackers@postgresql.org, strk@keybit.net
  Subject: Re: Uninterruptable regexp_replace in 9.3.1 ?
  In-Reply-To: <53077EED.2000907@2ndquadrant.com>
  References: <20140221091759.GK6924@localhost> <530774E5.5040105@2ndquadrant.com> <D4594E29-6A28-43C0-BD33-FC3EE8A23683@phlo.org> <53077EED.2000907@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox