X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 28B9D11F665A for ; Thu, 30 Mar 2006 16:45:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12763-09 for ; Thu, 30 Mar 2006 16:45:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fon.nation-net.com (213-2-2-26.uk.vianw.net [213.2.2.26]) by postgresql.org (Postfix) with ESMTP id A580211F6672 for ; Thu, 30 Mar 2006 16:45:32 -0400 (AST) Received: from fon.nation-net.com (localhost [127.0.0.1]) by fon.nation-net.com (Postfix) with ESMTP id 38601136EC7 for ; Thu, 30 Mar 2006 21:45:32 +0100 (BST) Received: from eddie.acentral.co.uk (80-192-144-33.cable.ubr04.pres.blueyonder.co.uk [80.192.144.33]) by fon.nation-net.com (Postfix) with ESMTP id 10C6E136E8B for ; Thu, 30 Mar 2006 21:45:32 +0100 (BST) Received: from eddie.acentral.co.uk (eddie.acentral.co.uk [127.0.0.1]) by eddie.acentral.co.uk (Postfix) with ESMTP id 347EF75D9F for ; Thu, 30 Mar 2006 21:45:34 +0100 (BST) Received: from localhost.localdomain (unknown [10.0.0.29]) by eddie.acentral.co.uk (Postfix) with SMTP id 1A11875D13 for ; Thu, 30 Mar 2006 21:45:34 +0100 (BST) Date: Thu, 30 Mar 2006 21:45:31 +0100 From: Gavin Hamill To: pgsql-performance@postgresql.org Subject: Re: CREATE INDEX rather sluggish Message-Id: <20060330214531.ce6620e1.gdh@laterooms.com> In-Reply-To: <1143738524.13549.103.camel@localhost.localdomain> References: <442B9625.1060408@laterooms.com> <1143738524.13549.103.camel@localhost.localdomain> X-Mailer: Sylpheed version 2.1.1 (GTK+ 2.8.6; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-AV-Checked: ClamAV using ClamSMTP X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.575 required=5 tests=[AWL=0.575] X-Spam-Score: 0.575 X-Spam-Level: X-Archive-Number: 200603/630 X-Sequence-Number: 18067 On Thu, 30 Mar 2006 18:08:44 +0100 Simon Riggs wrote: Hello again Simon :) > The index build time varies according to the number and type of the > datatypes, as well as the distribution of values in the table. As well > as the number of rows in the table. > > Note the x10 factor to index AreaID (integer) v KeywordType (vchar(20)) Fair enough. :) Is there much of a performance increase by using fixed-length character fields instead of varchars? > Try trace_sort = on and then rerun the index builds to see what's > happening there. We've speeded sort up by about 2.5 times in the current > development version, but it does just run in single threaded mode so > your 8 CPUs aren't helping there. Yum - I look forward to the 8.2 release =) > Looks like you might be just over the maintenance_work_mem limit for the > last index builds. You can try doubling maintenance_work_mem. You were right - needed ~370MB ... I'm happy to alloc 1GB to allow for db growth.. > The extended runtime for KeywordType is interesting in comparison to > LowerText, which on the face of it is a longer column. My guess would be > that LowerText is fairly unique and sorts quickly, whereas KeywordType > is fairly non-unique with a high average row length that require > complete string comparison before deciding it is actually the same > value.