pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sulamul@gmail.com
Cc: bossartn@amazon.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: inefficient loop in StandbyReleaseLockList()
Date: Thu, 28 Oct 2021 18:24:51 -0400
Message-ID: <560364.1635459891@sss.pgh.pa.us> (raw)
In-Reply-To: <20211028221424.6wtcse3qkbf2cmqo@alap3.anarazel.de>
References: <CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com>
	<CAAJ_b94_awY-VfbLbzxm4zNni3NXxG3wrSkSgnHyCDqHnT+eJg@mail.gmail.com>
	<20211028.155751.1898631306946946681.horikyota.ntt@gmail.com>
	<20211028220748.6ekrl74minwq75f4@alap3.anarazel.de>
	<20211028221424.6wtcse3qkbf2cmqo@alap3.anarazel.de>

Andres Freund <andres@anarazel.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





view thread (41+ messages)  latest in thread

Message-ID: <560364.1635459891@sss.pgh.pa.us>
Permalink:  ../560364.1635459891@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/560364.1635459891@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, horikyota.ntt@gmail.com, sulamul@gmail.com, bossartn@amazon.com
  Subject: Re: inefficient loop in StandbyReleaseLockList()
  In-Reply-To: <560364.1635459891@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox