Re: inefficient loop in StandbyReleaseLockList()

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

Andres Freund <andres(at)anarazel(dot)de> writes:
> Which leads to to wonder whether the better fix would be to switch to deleting
> the last element, but still use the while (!empty) style. That should convert
> the O(n^2) due to 1cff1b9 back to O(n). It might or might not be faster/slower
> than using foreach(), but it should be within the same ballpark.

Does it matter what order we're releasing the locks in?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-10-28 22:40:12 Re: inefficient loop in StandbyReleaseLockList()
Previous Message Andres Freund 2021-10-28 22:14:24 Re: inefficient loop in StandbyReleaseLockList()