Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3LEs-0005ed-JC for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 08:54:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3LEr-0006Uk-Nl for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 08:54:45 +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 1Y3LEq-0006Ud-6Z for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 08:54:44 +0000 Received: from mail.taisia.fi ([2001:1bc8:100:6::a101]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3LEn-0001fv-M4 for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 08:54:43 +0000 Received: from [0.0.0.0] (timantti.taisia.fi [213.157.67.233]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.taisia.fi (Postfix) with ESMTPS id 5D577601F9; Tue, 23 Dec 2014 10:54:40 +0200 (EET) Message-ID: <54992DCF.4040908@ohmu.fi> Date: Tue, 23 Dec 2014 10:54:39 +0200 From: Oskari Saarenmaa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Andres Freund , Peter Eisentraut , Robert Haas CC: Michael Paquier , Jim Nasby , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY 2.0 References: <20140827064120.GZ21544@awork2.anarazel.de> <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> In-Reply-To: <61E955E2-61D7-45E8-BC66-F021EA0CE3CE@2ndquadrant.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 13.11.2014, 23:50, Andres Freund kirjoitti: > On November 13, 2014 10:23:41 PM CET, Peter Eisentraut wrote: >> On 11/12/14 7:31 PM, Andres Freund wrote: >>> Yes, it sucks. But it beats not being able to reindex a relation with >> a >>> primary key (referenced by a fkey) without waiting several hours by a >>> couple magnitudes. And that's the current situation. >> >> That's fine, but we have, for better or worse, defined CONCURRENTLY := >> does not take exclusive locks. Use a different adverb for an >> in-between >> facility. > > I think that's not actually a service to our users. They'll have to adapt their scripts and knowledge when we get around to the more concurrent version. What exactly CONCURRENTLY means is already not strictly defined and differs between the actions. > > I'll note that DROP INDEX CONCURRENTLY actually already internally acquires an AEL lock. Although it's a bit harder to see the consequences of that. If the short-lived lock is the only blocker for this feature at the moment could we just require an additional qualifier for CONCURRENTLY (FORCE?) until the lock can be removed, something like: tmp# REINDEX INDEX CONCURRENTLY tmp_pkey; ERROR: REINDEX INDEX CONCURRENTLY is not fully concurrent; use REINDEX INDEX CONCURRENTLY FORCE to perform reindex with a short-lived lock. tmp=# REINDEX INDEX CONCURRENTLY FORCE tmp_pkey; REINDEX It's not optimal, but currently there's no way to reindex a primary key anywhere close to concurrently and a short lock would be a huge improvement over the current situation. / Oskari -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers