Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XpIO7-0004a8-Qo for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Nov 2014 15:02:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XpIO7-00025G-6a for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Nov 2014 15:02:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XpIO6-00024w-44 for pgsql-hackers@postgresql.org; Fri, 14 Nov 2014 15:02:14 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XpIO2-00045M-8C for pgsql-hackers@postgresql.org; Fri, 14 Nov 2014 15:02:12 +0000 Received: from intern.anarazel.de (p54AF4A9C.dip0.t-ipconnect.de [84.175.74.156]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 9D099460002; Fri, 14 Nov 2014 16:02:08 +0100 (CET) Date: Fri, 14 Nov 2014 16:02:08 +0100 From: Andres Freund To: Jim Nasby Cc: Peter Eisentraut , Robert Haas , Michael Paquier , Jim Nasby , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY 2.0 Message-ID: <20141114150208.GC11733@alap3.anarazel.de> References: <545B8AD2.8030203@gmx.net> <20141112213912.GH13473@awork2.anarazel.de> <20141113003106.GJ13473@awork2.anarazel.de> <5465215D.2060505@gmx.net> <61E955E2-61D7-45E8-BC66-F021EA0CE3CE@2ndquadrant.com> <5465B770.70604@BlueTreble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5465B770.70604@BlueTreble.com> X-Pg-Spam-Score: -1.1 (-) 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 2014-11-14 02:04:00 -0600, Jim Nasby wrote: > On 11/13/14, 3:50 PM, Andres Freund wrote: > Having been responsible for a site where downtime was a 6 figure > dollar amount per hour, I've spent a LOT of time worrying about lock > problems. The really big issue here isn't grabbing an exclusive lock; > it's grabbing one at some random time when no one is there to actively > monitor what's happening. (If you can't handle *any* exclusive locks, > that also means you can never do an ALTER TABLE ADD COLUMN either.) > With that in mind, would it be possible to set this up so that the > time-consuming process of building the new index file happens first, > and then (optionally) some sort of DBA action is required to actually > do the relfilenode swap? I realize that's not the most elegant > solution, but it's WAY better than this feature not hitting 9.5 and > people having to hand-code a solution. I don't think having a multi step version of the feature and it not making into 9.5 are synonymous. And I really don't want to make it even more complex before we have the basic version in. I think a split like your: > Possible syntax: > REINDEX CONCURRENTLY -- Does what current patch does > REINDEX CONCURRENT BUILD -- Builds new files > REINDEX CONCURRENT SWAP -- Swaps new files in could make sense, but it's really an additional feature ontop. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers