Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 75D63797B1E for ; Wed, 17 Mar 2010 15:45:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77831-07 for ; Wed, 17 Mar 2010 18:45:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mail.postgresql.org (Postfix) with ESMTP id C1F09799303 for ; Wed, 17 Mar 2010 15:45:08 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0LwEDC-1Na1RP1Ndu-0186LG; Wed, 17 Mar 2010 19:45:00 +0100 Message-ID: <4BA12328.4080803@2ndquadrant.com> Date: Wed, 17 Mar 2010 14:44:56 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Rob Wultsch CC: Tom Lane , pgsql-performance@postgresql.org Subject: Re: Building multiple indexes concurrently References: <2c5ef4e31003161804l5e32ceb9v6b7019118f30004d@mail.gmail.com> <4BA0AAD1.5040508@2ndquadrant.com> <27969.1268836243@sss.pgh.pa.us> <2c5ef4e31003170807x3f26dd77v57a1631094bc5270@mail.gmail.com> In-Reply-To: <2c5ef4e31003170807x3f26dd77v57a1631094bc5270@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1+S6Q4SX5RSJ5LPd48LdF/WNuUNRhNRR+LFzfz E4sRa/MVQY71Im1DXJ3DWI71LszDI2QgRZBqzvAy80VQJxoQBv 4Qt3Ia1xuRwTKh7iGdir3KnZ/gxThcu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/204 X-Sequence-Number: 38029 Rob Wultsch wrote: > On Wed, Mar 17, 2010 at 7:30 AM, Tom Lane wrote: > >> No, it's not optimistic in the least, at least not since we implemented >> synchronized seqscans (in 8.3 or thereabouts). >> > Where can I find details about this in the documentation? > It's a behind the scenes optimization so it's not really documented on the user side very well as far as I know; easy to forget it's even there as I did this morning. http://j-davis.com/postgresql/syncscan/syncscan.pdf is a presentation covering it, and http://j-davis.com/postgresql/83v82_scans.html is also helpful. While my pessimism on this part may have been overwrought, note the message interleaved on the list today with this discussion from Bob Lunney discussing the other issue I brought up: "When using 8-way parallel restore against a six-disk RAID 10 group I found that table and index scan performance dropped by about 10x. I/O performance was restored by either clustering the tables one at a time, or by dropping and restoring them one at a time. The only reason I can come up with for this behavior is file fragmentation and increased seek times." Now, Bob's situation may very well involve a heavy dose of table fragmentation from multiple active loading processes rather than index fragmentation, but this class of problem is common when trying to do too many things at the same time. I'd hate to see you chase a short-term optimization (reduce total index built time) at the expense of long-term overhead (resulting indexes are not as efficient to scan). -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us