Re: inefficient loop in StandbyReleaseLockList()

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: bossartn@amazon.com
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, michael@paquier.xyz, andres@anarazel.de, sulamul@gmail.com, pgsql-hackers@postgresql.org
Date: 2021-11-02T15:35:55Z
Lists: pgsql-hackers
I've pushed the SyncPostCheckpoint change, and I think I'm going
to stop here.  It's not clear that the remaining list_delete_first
callers have any real problem; and changing them would be complex.
We can revisit the question if we find out there is an issue.
Or, if somebody else wants to pursue the issue, feel free.

			regards, tom lane



Commits

  1. Doc: add some notes about performance of the List functions.

  2. Avoid O(N^2) behavior in SyncPostCheckpoint().

  3. Avoid some other O(N^2) hazards in list manipulation.

  4. Avoid O(N^2) behavior when the standby process releases many locks.