]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid some other O(N^2) hazards in list manipulation.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 1 Nov 2021 20:24:40 +0000 (16:24 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 1 Nov 2021 20:24:40 +0000 (16:24 -0400)
commite477642a1ba8041c94cae2f8bbdb689f05cb0260
treea476a1eff3c80c95badd87efd02d72b54f927700
parent17227825ca4288c70af45038ac6af26be7fde570
Avoid some other O(N^2) hazards in list manipulation.

In the same spirit as 6301c3ada, fix some more places where we were
using list_delete_first() in a loop and thereby risking O(N^2)
behavior.  It's not clear that the lists manipulated in these spots
can get long enough to be really problematic ... but it's not clear
that they can't, either, and the fixes are simple enough.

As before, back-patch to v13.

Discussion: https://postgr.es/m/CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com
contrib/pg_trgm/trgm_regexp.c
src/backend/executor/nodeAgg.c
src/backend/jit/llvm/llvmjit.c