Re: inefficient loop in StandbyReleaseLockList()

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "sulamul(at)gmail(dot)com" <sulamul(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inefficient loop in StandbyReleaseLockList()
Date: 2021-10-28 23:52:48
Message-ID: 20211028235248.4kbhtcqn2hvjukbd@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-10-28 19:24:08 -0400, Tom Lane wrote:
> "Bossart, Nathan" <bossartn(at)amazon(dot)com> writes:
> > On 10/28/21, 3:25 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-10-29 00:44:21 Re: Minimal logical decoding on standbys
Previous Message Tom Lane 2021-10-28 23:24:08 Re: inefficient loop in StandbyReleaseLockList()