Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results - Mailing list pgsql-general

From Tom Lane
Subject Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results
Date
Msg-id 27093.1356285306@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
"David Johnston" <polobo@yahoo.com> writes:
>> while it might work to reverse the order in a regex, I have experienced
>> severe slowdown when the pattern comes from table data

> If it is indeed related to the custom reverse query the fact that you are
> going through an SQL wrapper to access a c-level function is inevitably
> going to degrade performance.

I believe that in most situations of interest, the SQL wrapper would get
"inlined" and thus create no significant per-row penalty.  It's possible
this isn't happening in some specific case, but as you say we'd need to
see a concrete example to know one way or the other.

Another point that comes to mind is that "pattern comes from table data"
probably means "query uses a whole lot of different patterns over its
lifetime".  Each different pattern is going to require regex
compilation, which is not a particularly cheap operation.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Insert Assertion Failed in strcoll_l.c:112
Next
From: Adrian Klaver
Date:
Subject: Re: downgrading a database