Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8Sek-0004qC-BS for pgsql-hackers@arkaria.postgresql.org; Wed, 10 May 2017 14:31:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8Sej-0000Xb-Bu for pgsql-hackers@arkaria.postgresql.org; Wed, 10 May 2017 14:31:57 +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 1d8Sei-0000X8-Jk; Wed, 10 May 2017 14:31:56 +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 1d8Sbz-0007to-VY; Wed, 10 May 2017 14:29:09 +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 v4AET2SU002914; Wed, 10 May 2017 10:29:02 -0400 From: Tom Lane To: Petr Jelinek cc: Peter Eisentraut , Andres Freund , pgsql-hackers@postgresql.org, Noah Misch , Jason Petersen , Michael Paquier , PostgreSQL mailing lists Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression In-reply-to: <20d59e42-4a08-fa34-29df-9f54b3ef5ba7@2ndquadrant.com> References: <99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com> <20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de> <1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com> <20170427055806.uviqrl57lkgcmmmy@alap3.anarazel.de> <20170427062304.gxh3rczhh6vblrwh@alap3.anarazel.de> <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> Comments: In-reply-to Petr Jelinek message dated "Wed, 10 May 2017 15:52:14 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2912.1494426542.1@sss.pgh.pa.us> Date: Wed, 10 May 2017 10:29:02 -0400 Message-ID: <2913.1494426542@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Petr Jelinek writes: > On 10/05/17 07:09, Peter Eisentraut wrote: >> I think the correct fix is to have nextval() and ALTER SEQUENCE use >> sensible lock levels so that they block each other. Since >> nextval() currently uses AccessShareLock, the suggestion was for >> ALTER SEQUENCE to therefore use AccessExclusiveLock. But I think a >> better idea would be for nextval() to use RowExclusiveLock >> (analogous to UPDATE) and ALTER SEQUENCE to use >> ShareRowExclusiveLock, which would also satisfy issue #1. > When I proposed this upstream, Andres raised concern about performance > of nextval() if we do this, did you try to run any benchmark on this? As long as it doesn't block, the change in lock strength doesn't actually make any speed difference does it? If we were taking AccessExclusiveLock somewhere, I'd be worried about the cost of WAL-logging those; but this proposal does not include any. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers