Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xofdr-0005dx-RQ for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2014 21:39:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xofdr-0008S7-C1 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2014 21:39:55 +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 1Xofdq-0008S1-Eh for pgsql-hackers@postgresql.org; Wed, 12 Nov 2014 21:39:54 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xofdi-0000J9-FY for pgsql-hackers@postgresql.org; Wed, 12 Nov 2014 21:39:53 +0000 Received: from anarazel.de (p5DDC4954.dip0.t-ipconnect.de [93.220.73.84]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0LsdiP-1XzELI0n0b-012JTa; Wed, 12 Nov 2014 22:39:13 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 580D7100986; Wed, 12 Nov 2014 22:39:12 +0100 (CET) Date: Wed, 12 Nov 2014 22:39:12 +0100 From: Andres Freund To: Robert Haas Cc: Peter Eisentraut , Michael Paquier , Jim Nasby , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY 2.0 Message-ID: <20141112213912.GH13473@awork2.anarazel.de> References: <52CF45E8.6090208@nasby.net> <20140827064120.GZ21544@awork2.anarazel.de> <545B8AD2.8030203@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:zr1xuJ/s40cUYKKwZ8jQRdL1oyMA9i4s+0qGzYpz1pf k/P+TOTonLIOkIOssG0ZCPGmBmG+MrsQ6Iz6mDcczcuqmE6pqt UZ4RHOV6yGRUNIQhVSUX3bsxcmjzTs+U3YM3CTf+fL5xHWVkqL 3EtZm1a5A17NkuhZvMQ14SuMfg8hUEoAJ7jqRpFf3paiV0JybO OsL5eYxiWn7EAtiKvXfpNngSicS2g+FuD1OFySceb2KtsPylNY VSONfs0iZnduBZYdXH9JqERC8niOB0JszvIH75BLvCbasXF710 2NvbZK3RMta7+3B7EkofoCfGv2gNXvGS2P0ZPAsITs+h9CwreW 8n0MjATneuH3LxtXu+HFFfNRVONsshDUfuvTf+Qkh X-UI-Out-Filterresults: notjunk:1; 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 2014-11-12 16:11:58 -0500, Robert Haas wrote: > On Wed, Nov 12, 2014 at 4:10 PM, Robert Haas wrote: > > On Thu, Nov 6, 2014 at 9:50 AM, Peter Eisentraut wrote: > >> If REINDEX cannot work without an exclusive lock, we should invent some > >> other qualifier, like WITH FEWER LOCKS. > > > > What he said. I'm unconvinced. A *short* exclusive lock (just to update two pg_class row), still gives most of the benefits of CONCURRENTLY. Also, I do think we can get rid of that period in the not too far away future. > But more to the point .... why, precisely, can't this work without an > AccessExclusiveLock? And can't we fix that instead of setting for > something clearly inferior? It's nontrivial to fix, but I think we can fix it at some point. I just think we should get the *major* part of the feature before investing lots of time making it even better. There's *very* frequent questions about having this. And people do really dangerous stuff (like manually updating pg_class.relfilenode and such) to cope. The problem is that it's very hard to avoid the wrong index's relfilenode being used when swapping the relfilenodes between two indexes. 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