Re: inefficient loop in StandbyReleaseLockList() - Mailing list pgsql-hackers

From Andres Freund
Subject Re: inefficient loop in StandbyReleaseLockList()
Date
Msg-id 20211028235248.4kbhtcqn2hvjukbd@alap3.anarazel.de
Whole thread Raw
In response to Re: inefficient loop in StandbyReleaseLockList()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: inefficient loop in StandbyReleaseLockList()  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

On 2021-10-28 19:24:08 -0400, Tom Lane wrote:
> "Bossart, Nathan" <bossartn@amazon.com> writes:
> > On 10/28/21, 3:25 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> >> Does it matter what order we're releasing the locks in?
> 
> > I'm not seeing anything that indicates the ordering matters.  AFAICT
> > either approach would work in this case.  IMO changing the order is
> > scarier than switching to foreach(), though.
> 
> Yeah, that was my feeling...

I suspect the reverse lock order release could be tad faster. But I probably
wouldn't change it either - I was more thinking of some of the other cases
that deleted the first element, here it's a bit harder to know wether there's
a chance of a CFI() or such.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: inefficient loop in StandbyReleaseLockList()
Next
From: Robert Haas
Date:
Subject: Re: Minimal logical decoding on standbys