pgsql: Avoid some other O(N^2) hazards in list manipulation. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Avoid some other O(N^2) hazards in list manipulation.
Date
Msg-id E1mhdrU-0001fF-8U@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ad87bf355214c47221263825b3a541062c71aea7

Modified Files
--------------
contrib/pg_trgm/trgm_regexp.c  | 25 +++++++++++++++++--------
src/backend/executor/nodeAgg.c | 17 +++++------------
src/backend/jit/llvm/llvmjit.c | 10 +++++-----
3 files changed, 27 insertions(+), 25 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Replace unicode characters in comments with ascii