Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d91kK-0004aM-R8 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 04:00:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d91kK-0006qi-Di for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 04:00:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d91kJ-0006q0-Fn; Fri, 12 May 2017 04:00:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d91kG-0001JS-RF; Fri, 12 May 2017 04:00:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4C3xuut025952; Thu, 11 May 2017 23:59:56 -0400 From: Tom Lane To: Andres Freund cc: Peter Eisentraut , Petr Jelinek , pgsql-hackers@postgresql.org, Noah Misch , Jason Petersen , Michael Paquier , PostgreSQL mailing lists Subject: Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression In-reply-to: <20170511212839.b6i6xccdv5slrttx@alap3.anarazel.de> References: <20170430080517.GA811193@rfd.leadboat.com> <59aeb834-b113-6769-bfe4-65f2f8c875e3@2ndquadrant.com> <20170507234334.yimkp6aq2o43wtt2@alap3.anarazel.de> <4521f870-bb1f-1b29-3b3f-42419696efe7@2ndquadrant.com> <20d59e42-4a08-fa34-29df-9f54b3ef5ba7@2ndquadrant.com> <2913.1494426542@sss.pgh.pa.us> <20170510162450.bzfktkeexezepf6c@alap3.anarazel.de> <90255529-1de1-0aad-c545-f75d08479a9a@2ndquadrant.com> <8863.1494537678@sss.pgh.pa.us> <20170511212839.b6i6xccdv5slrttx@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 11 May 2017 14:28:39 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25949.1494561596.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 11 May 2017 23:59:56 -0400 Message-ID: <25950.1494561596@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andres Freund writes: > On 2017-05-11 17:21:18 -0400, Tom Lane wrote: >> I doubt my machine is 6X faster than yours, >> so this indicates that the subtransaction overhead is pretty real. > Isn't that pretty much the point? The whole open_share_lock() > optimization looks like it really only can make a difference with > subtransactions? Uh, no; I'm pretty sure that that code is older than subtransactions. The point of it is to avoid taking and releasing a lock over and over within a single transaction. >> Hm. I don't think that's a sufficient code change, because if you do it >> like that then the lock remains held after nextval() returns. > Hm? That's not new, is it? We previously did a LockRelationOid(seq->rel= id) and > then relation_open(seq->relid, NoLock)? Right, but the existing code is *designed* to hold the lock till end of top-level transaction, regardless of what happens in any subtransaction. My understanding of your complaint is that you do not think that's OK for any lock stronger than AccessShareLock. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs