From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Some regular-expression performance hacking
Date: Sun, 14 Feb 2021 11:45:40 -0500
Message-ID: <1929732.1613321140@sss.pgh.pa.us> (raw)
In-Reply-To: <913516b8-c3d7-4dea-bf60-d735cf4673f1@www.fastmail.com>
References: <1340281.1613018383@sss.pgh.pa.us>
<85140bfb-516c-449b-8a03-7930abb42b88@www.fastmail.com>
<1813969.1613250697@sss.pgh.pa.us>
<913516b8-c3d7-4dea-bf60-d735cf4673f1@www.fastmail.com>
"Joel Jacobson" <joel@compiler.org> writes:
> I've successfully tested both patches against the 1.5M regexes-in-the-wild dataset.
> Out of the 1489489 (pattern, text string) pairs tested,
> there was only one single deviation:
> This 100577 bytes big regex (pattern_id = 207811)...
> ...
> ...previously raised...
> error invalid regular expression: regular expression is too complex
> ...but now goes through:
> Nice. The patched regex engine is apparently capable of handling even more complex regexes than before.
Yeah. There are various limitations that can lead to REG_ETOOBIG, but the
main ones are "too many states" and "too many arcs". The RAINBOW change
directly reduces the number of arcs and thus makes larger regexes feasible.
I'm sure it's coincidental that the one such example you captured happens
to be fixed by this change, but hey I'll take it.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, joel@compiler.org, pgsql-hackers@lists.postgresql.org
Subject: Re: Some regular-expression performance hacking
In-Reply-To: <1929732.1613321140@sss.pgh.pa.us>
* 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