Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgEku-0006Xv-GZ for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Oct 2021 23:24:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgEkt-0005lW-FU for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Oct 2021 23:24:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgEkt-0005lM-6r for pgsql-hackers@lists.postgresql.org; Thu, 28 Oct 2021 23:24:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgEkq-0004BK-Qh for pgsql-hackers@postgresql.org; Thu, 28 Oct 2021 23:24:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19SNO86e565037; Thu, 28 Oct 2021 19:24:08 -0400 From: Tom Lane To: "Bossart, Nathan" cc: Andres Freund , Kyotaro Horiguchi , "sulamul@gmail.com" , "pgsql-hackers@postgresql.org" Subject: Re: inefficient loop in StandbyReleaseLockList() In-reply-to: References: <20211028.155751.1898631306946946681.horikyota.ntt@gmail.com> <20211028220748.6ekrl74minwq75f4@alap3.anarazel.de> <20211028221424.6wtcse3qkbf2cmqo@alap3.anarazel.de> <560364.1635459891@sss.pgh.pa.us> Comments: In-reply-to "Bossart, Nathan" message dated "Thu, 28 Oct 2021 23:15:50 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <565035.1635463448.1@sss.pgh.pa.us> Date: Thu, 28 Oct 2021 19:24:08 -0400 Message-ID: <565036.1635463448@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Bossart, Nathan" writes: > On 10/28/21, 3:25 PM, "Tom Lane" 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... regards, tom lane