Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2F4CE1337BD3 for ; Mon, 11 Apr 2011 13:45:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 33333-06 for ; Mon, 11 Apr 2011 16:45:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 7E2361337BDA for ; Mon, 11 Apr 2011 13:45:30 -0300 (ADT) Received: from [192.168.1.3] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MCfaM-1Pzo531gdG-008yKX; Mon, 11 Apr 2011 09:41:32 +0200 Message-ID: <4DA2B0A4.6050605@2ndquadrant.com> Date: Mon, 11 Apr 2011 03:41:24 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Scott Marlowe CC: pgsql-performance@postgresql.org Subject: Re: Multiple index builds on same table - in one sweep? References: <4325.1302369004@sss.pgh.pa.us> <4DA2679D.5000207@2ndQuadrant.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:cFJJka9GeO4Fzfy9IUO/5ewPpX7bpn9+ZYSNbRS77Lw tXfpfj1nH6pijcRzB7yv0mnpRiRW98zzu/chEFUmpwiEXLJV95 toek3bMNcKeaFwBSn+165Zz8MY/aLBAx+VdIkW1Om6RurZyPHw aeZ5+La7MzTJVwBinJqDVVtNVu5OrBw170Gw4zZigkRLt4iZbt IkYtqYZT/V/70q3fSr/i4DAcoWhtQ7HXHC66LwhDCY= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/104 X-Sequence-Number: 43166 Scott Marlowe wrote: > FYI, in 8.3.13 I get this for all but one index: > > ERROR: deadlock detected > DETAIL: Process 24488 waits for ShareLock on virtual transaction > 64/825033; blocked by process 27505. > Process 27505 waits for ShareUpdateExclusiveLock on relation 297369165 > of database 278059474; blocked by process 24488. > Is that trying to build them by hand? The upthread request here is actually already on the TODO list at http://wiki.postgresql.org/wiki/Todo and it talks a bit about what works and what doesn't right now: Allow multiple indexes to be created concurrently, ideally via a single heap scan -pg_restore allows parallel index builds, but it is done via subprocesses, and there is no SQL interface for this. This whole idea was all the rage on these lists circa early 2008, but parallel restore seems to have satisfied enough of the demand in this general area that it doesn't come up quite as much now. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books