postgresql/src
Tom Lane 8424dfced7 Avoid O(N^2) behavior when the standby process releases many locks.
When replaying a transaction that held many exclusive locks on the
primary, a standby server's startup process would expend O(N^2)
effort on manipulating the list of locks.  This code was fine when
written, but commit 1cff1b95a made repetitive list_delete_first()
calls inefficient, as explained in its commit message.  Fix by just
iterating the list normally, and releasing storage only when done.
(This'd be inadequate if we needed to recover from an error occurring
partway through; but we don't.)

Back-patch to v13 where 1cff1b95a came in.

Nathan Bossart

Discussion: https://postgr.es/m/CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com
2021-10-31 15:31:38 -04:00
..
backend Avoid O(N^2) behavior when the standby process releases many locks. 2021-10-31 15:31:38 -04:00
bin Clarify that --system reindexes system catalogs *only* 2021-10-27 16:28:22 +02:00
common Fix memory leak in pg_hmac 2021-10-01 22:47:05 +02:00
fe_utils Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
include Revert "Remove unused wait events." 2021-10-26 08:19:33 +05:30
interfaces Translation updates 2021-09-20 16:23:13 +02:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Fix checking of query type in plpgsql's RETURN QUERY command. 2021-10-03 13:21:20 -04:00
port AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. 2021-10-28 11:45:14 -04:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:32 -04:00
tools Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY. 2021-10-23 18:36:42 -07:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Add module build directory to the PATH for TAP tests 2021-10-22 09:50:16 -04:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00