]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Suppress unnecessary regex subre nodes in a couple more cases.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Mar 2021 17:14:14 +0000 (12:14 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Mar 2021 17:14:14 +0000 (12:14 -0500)
commit4604f83fdfe030a2f1984159ede5270c1d825310
tree75d9ab0ac8006905246dabfbef7b6ff1d71e8f31
parent0c3405cf11a12da1a4278c6833f4d979fe06c866
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
src/backend/regex/regcomp.c