postgresql/src/backend
Tom Lane facce1da91 Fix performance bug in regexp's citerdissect/creviterdissect.
After detecting a sub-match "dissect" failure (i.e., a backref match
failure) in the i'th sub-match of an iteration node, we should proceed
by adjusting the attempted length of the i'th submatch.  As coded,
though, these functions changed the attempted length of the *last*
sub-match, and only after exhausting all possibilities for that would
they back up to adjust the next-to-last sub-match, and then the
second-from-last, etc; all of which is wasted effort, since only
changing the start or length of the i'th sub-match can possibly make
it succeed.  This oversight creates the possibility for exponentially
bad performance.  Fortunately the problem is masked in most cases by
optimizations or constraints applied elsewhere; which explains why
we'd not noticed it before.  But it is possible to reach the problem
with fairly simple, if contrived, regexps.

Oversight in my commit 173e29aa5.  That's pretty ancient now,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/1808998.1629412269@sss.pgh.pa.us
2021-08-20 14:19:04 -04:00
..
access Revert analyze support for partitioned tables 2021-08-16 17:27:52 -04:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Prevent ALTER TYPE/DOMAIN/OPERATOR from changing extension membership. 2021-08-17 14:29:22 -04:00
commands Prevent ALTER TYPE/DOMAIN/OPERATOR from changing extension membership. 2021-08-17 14:29:22 -04:00
executor Use appropriate tuple descriptor in FDW batching 2021-08-12 22:10:06 +02:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Clarify some comments making use of leetspeak term "up2date" 2021-07-28 10:31:24 +09:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Set type identifier on BIO 2021-08-17 14:30:01 +02:00
main process startup: Centralize pgwin32_signal_initialize() calls. 2021-08-05 12:36:06 -07:00
nodes Check the size in COPY_POINTER_FIELD 2021-08-08 18:46:34 +02:00
optimizer Change NestPath node to contain JoinPath node 2021-08-08 18:46:34 +02:00
parser Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. 2021-08-19 12:12:35 -04:00
partitioning Allow ordered partition scans in more cases 2021-08-03 12:25:52 +12:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:09:00 +12:00
postmaster Revert analyze support for partitioned tables 2021-08-16 17:27:52 -04:00
regex Fix performance bug in regexp's citerdissect/creviterdissect. 2021-08-20 14:19:04 -04:00
replication Rename LOGICAL_REP_MSG_STREAM_END to LOGICAL_REP_MSG_STREAM_STOP. 2021-08-19 09:34:26 +05:30
rewrite Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Un-break s_lock_test. 2021-08-13 14:42:27 -04:00
tcop process startup: Always call Init[Auxiliary]Process() before BaseInit(). 2021-08-05 15:36:59 -07:00
tsearch Improve various places that double the size of a buffer 2021-07-01 15:29:06 +12:00
utils Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe. 2021-08-19 05:07:53 -07:00
.gitignore
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk
nls.mk Translation updates 2021-05-10 14:36:21 +02:00