pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pedro Gimeno <pgsql-004@personal.formauri.es>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Sandro Santilli <strk@keybit.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: uninterruptable regexp_replace in 9.2 and 9.3
Date: Sun, 02 Mar 2014 14:07:29 +0100
Message-ID: <53132D11.2010305@personal.formauri.es> (raw)
In-Reply-To: <17158.1393735118@sss.pgh.pa.us>
References: <20140228112858.GE5011@localhost>
	<5310925B.8010809@personal.formauri.es>
	<17158.1393735118@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom Lane wrote, On 2014-03-02 05:38:

> The performance problem we're looking at comes directly from the
> backtracking that's done to ensure that we detect a match in case the
> pattern has this sort of pathological behavior.

It is my understanding that the bug reported by the OP is not a
performance problem, but PostgreSQL's failure to interrupt the
processing if it takes too long, when statement_timeout is set.

If it's not possible to interrupt it, then maybe an approach similar to
PHP's backtracking limit could be implemented.

I'm not familiar at all with PostgreSQL's code, but I wonder if adding a
CHECK_FOR_INTERRUPTS every sensible number of backtracks could solve the
original bug.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <53132D11.2010305@personal.formauri.es>
Permalink:  ../53132D11.2010305@personal.formauri.es/
Also on:    postgresql.org/message-id/53132D11.2010305@personal.formauri.es

 · 

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: pgsql-004@personal.formauri.es, tgl@sss.pgh.pa.us, strk@keybit.net
  Subject: Re: uninterruptable regexp_replace in 9.2 and 9.3
  In-Reply-To: <53132D11.2010305@personal.formauri.es>
  References: <20140228112858.GE5011@localhost> <5310925B.8010809@personal.formauri.es> <17158.1393735118@sss.pgh.pa.us> <53132D11.2010305@personal.formauri.es>

* 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