pgsql: Suppress unnecessary regex subre nodes in a couple more cases.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Suppress unnecessary regex subre nodes in a couple more cases.
Date: 2021-03-02 17:14:26
Message-ID: E1lH8bK-0006xe-4W@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Suppress unnecessary regex subre nodes in a couple more cases.

This extends the changes made in commit cebc1d34e, teaching
parseqatom() to generate fewer or cheaper subre nodes in some edge
cases. The case of interest here is a quantified atom that is "messy"
only because it has greediness opposite to what preceded it (whereas
captures and backrefs are intrinsically messy). In this case we don't
need an iteration node, since we don't care where the sub-matches of
the quantifier are; and we might also not need a second concatenation
node. This seems of only marginal real-world use according to my
testing, but I wanted to get it in before wrapping up this series of
regex performance fixes.

Discussion: https://postgr.es/m/1340281.1613018383@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4604f83fdfe030a2f1984159ede5270c1d825310

Modified Files
--------------
src/backend/regex/regcomp.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2021-03-02 18:41:00 pgsql: Use native path separators to pg_ctl in initdb
Previous Message Michael Paquier 2021-03-02 04:21:09 pgsql: Fix duplicated test case in TAP tests of reindexdb