Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciRwq-0007TS-Hv for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 20:31:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciRwp-0004MU-JM for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 20:31:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciRvK-0001i5-RL for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 20:29:34 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ciRvH-0000jM-3d for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 20:29:33 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1ciRv2-0007K5-NC; Mon, 27 Feb 2017 15:29:16 -0500 Date: Mon, 27 Feb 2017 15:29:16 -0500 From: Bruce Momjian To: Michael Paquier Cc: Andreas Karlsson , Andres Freund , Robert Haas , Peter Eisentraut , Jim Nasby , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY 2.0 Message-ID: <20170227202916.GC421@momjian.us> References: <20150202141014.GA9201@alap3.anarazel.de> <4b6b0b72-94c8-79ad-baf1-b01587807315@proxel.se> <68cd9337-90ab-c654-ed6b-a32abc26e147@proxel.se> <1da61300-31e8-d416-1d41-56c15cd4753d@proxel.se> <083ea668-538e-06ae-c1a7-37b0edbeeb9c@proxel.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -0.4 (/) 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 On Fri, Feb 17, 2017 at 11:05:31PM +0900, Michael Paquier wrote: > On Fri, Feb 17, 2017 at 10:43 PM, Andreas Karlsson wrote: > > Thinking about this makes me wonder about why you decided to use a > > transaction per index in many of the steps rather than a transaction per > > step. Most steps should be quick. The only steps I think the makes sense to > > have a transaction per table are. > > I don't recall all the details to be honest :) > > > 1) When building indexes to avoid long running transactions. > > 2) When validating the new indexes, also to avoid long running transactions. > > > > But when swapping the indexes or when dropping the old indexes I do not see > > any reason to not just use one transaction per step since we do not even > > have to wait for any locks (other than WaitForLockers which we just want to > > call once anyway since all indexes relate to the same table). > > Perhaps, this really needs a careful lookup. > > By the way, as this patch is showing up for the first time in this > development cycle, would it be allowed in the last commit fest? That's > not a patch in the easy category, far from that, but it does not > present a new concept. FYI, the thread started on 2013-11-15. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers