Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C2F7A9FA24B for ; Fri, 19 Oct 2007 11:51:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 67428-01 for ; Fri, 19 Oct 2007 11:51:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id CAC7E9FA12D for ; Fri, 19 Oct 2007 11:51:44 -0300 (ADT) thread-index: AcgSX5sv8RTjsMC1R1WGceI66YOBLA== Received: from [172.24.32.184] ([62.232.55.118]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Oct 2007 10:52:00 -0400 Message-ID: <4718C41F.8090202@enterprisedb.com> Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 Date: Fri, 19 Oct 2007 15:50:07 +0100 From: "Heikki Linnakangas" User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: "Yinan Li" Cc: "Postgresql Performance" Subject: Re: how to improve the performance of creating index References: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> <47189D0F.6090707@enterprisedb.com> <01cb01c8125e$011183d0$03348b70$@ust.hk> In-Reply-To: <01cb01c8125e$011183d0$03348b70$@ust.hk> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Oct 2007 14:52:01.0140 (UTC) FILETIME=[9AFB1B40:01C8125F] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/229 X-Sequence-Number: 27251 Please keep the list cc'd so that others can help. Yinan Li wrote: > What version of Postgres are you using? > 8.2.4 > How much RAM does the box have? > 2G > How big is the table? > 256M tuples, each tuple contains 2 integers. > How long does the index build take? > About 2 hours > What kind of an I/O system do you have? > A SATA disk (7200 rpm) 2 hours does sound like a very long time. With a table like that, we're talking about ~7-9 GB worth of data if I did the math right. You could try lowering shared_buffers to something like 50 MB while you build the index, to leave more RAM available for OS caching. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com