Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C2D6F9FA444 for ; Fri, 19 Oct 2007 09:05:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17135-10 for ; Fri, 19 Oct 2007 09:05:04 -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 7AACD9FA3BD for ; Fri, 19 Oct 2007 09:05:04 -0300 (ADT) thread-index: AcgSSFLjFgR9nkMhT+eLSzhNKt48vg== 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 08:05:21 -0400 Message-ID: <47189D0F.6090707@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 13:03:27 +0100 From: "Heikki Linnakangas" User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: "Yinan Li" Cc: Subject: Re: how to improve the performance of creating index References: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> In-Reply-To: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Oct 2007 12:05:21.0250 (UTC) FILETIME=[5294FC20:01C81248] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/227 X-Sequence-Number: 27249 Yinan Li wrote: > I am trying to improve the performance of creating index. > > I've set shared_buffers = 1024MB > > Effective_cache_size = 1024MB > > Work_mem = 1GB > > Maintenance_work_mem=512MB > > (I'm sure that the server process has received the SIGHUP signal) > > However, when create index, I found that the memory used by Postgres is only > 50MB. And it is very slow. How to make it faster? What version of Postgres are you using? How much RAM does the box have? How big is the table? How long does the index build take? What kind of an I/O system do you have? maintenance_work_mem is the one that controls how much memory is used for the sort. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com