Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D7EF81337B49 for ; Tue, 25 Jan 2011 22:28:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 44028-04 for ; Wed, 26 Jan 2011 02:28:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149085.authsmtp.co.uk (outmail149085.authsmtp.co.uk [62.13.149.85]) by mail.postgresql.org (Postfix) with ESMTP id 197D61337B39 for ; Tue, 25 Jan 2011 22:28:46 -0400 (AST) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p0Q2Sktf072688; Wed, 26 Jan 2011 02:28:46 GMT Received: from Sidney-Stratton.local (dsl081-245-111.sfo1.dsl.speakeasy.net [64.81.245.111]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p0Q2SfXw065631; Wed, 26 Jan 2011 02:28:42 GMT Message-ID: <4D3F86D9.9080200@agliodbs.com> Date: Tue, 25 Jan 2011 18:28:41 -0800 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: Multicolun index creation never completes on 9.0.1/solaris References: <4D3F2D10.1020905@agliodbs.com> <21735.1295990515@sss.pgh.pa.us> In-Reply-To: <21735.1295990515@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: fea92fcd-28f3-11e0-97bb-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkGMA9GIUINWEQL c1AAcB1xOVtbHwkA AnYLWV5WWFd1Wi1z bxRZbBtfZk9QXgRr T0pMQFdNFEsoAX0D ZUh2FRl0cgNFeTB1 Z0NiECYODU14IxUp X0xcQ24bZGY1aH0W VxIKagNUcgFMehZC YlV+XD1vNG8XDQgF MDQGdxUsOSleIyNR XwdFLFQeTFZDFSQx TgwDGjNnG0AbSj97 JBsjMloRAEsKekI0 eQpnARRBdAQVDgRE Hlol X-Authentic-SMTP: 61633136333939.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201101/201 X-Sequence-Number: 29223 > trace_sort would be interesting. This is it so far: LOG: begin index sort: unique = f, workMem = 1048576, randomAccess = f STATEMENT: create index "write_log_accounttime_idx" on write_log (account_id, event_time); LOG: switching to external sort with 3745 tapes: CPU 9.06s/6.65u sec elapsed 21.68 sec STATEMENT: create index "write_log_accounttime_idx" on write_log (account_id, event_time); LOG: finished writing run 1 to tape 0: CPU 33.39s/149.02u sec elapsed 190.11 sec LOG: finished writing run 2 to tape 1: CPU 62.72s/371.06u sec elapsed 443.16 sec LOG: finished writing run 3 to tape 2: CPU 91.04s/599.43u sec elapsed 701.37 sec LOG: finished writing run 4 to tape 3: CPU 120.95s/823.59u sec elapsed 956.67 sec If it's going to take 3 minutes each to write each of 3745 tapes, that means completing in around 9 days. I wanted to see what this looks like with a single-column index, so I did one on event_time, which was even *worse*: LOG: begin index sort: unique = f, workMem = 1048576, randomAccess = f STATEMENT: create index "write_log_time_idx" on write_log (event_time); LOG: switching to external sort with 3745 tapes: CPU 14.45s/10.87u sec elapsed 26.19 sec LOG: finished writing run 1 to tape 0: CPU 135.32s/302.18u sec elapsed 447.44 sec ... run 2 didn't complete in even 1/2 hour. So the problem isn't multicolumn indexes, it's indexes on a table this large in general (a VARCHR index wasn't much faster to build). I'd guess that the PK index finished only because the table might have been in that rough physical order. For whatever reason, tape sort is being extra slow on this build on Solaris10; did we change anything between 8.4 and 9.0? Or is this possibly the build I used? I'll try to run a sort_trace on an 8.4.4 copy of the database. Oh, FWIW, the rough number of rows in the table: 1 486 530 000 -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com