summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAgg.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-10-31 15:31:29 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-10-31 15:31:44 -0400
commitdf238aed1090249a2bcd21e1688a398c6f513dfd (patch)
tree7a112c957deaf9fb61a279611cc6c6da2a96c576 /src/backend/executor/nodeAgg.c
parent4cd72add0579d33e741cb1a2effe6ee727a994dd (diff)
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
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
0 files changed, 0 insertions, 0 deletions