From yinanli@cse.ust.hk Fri Oct 19 11:57:40 2007 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7CB8B9FA228 for ; Fri, 19 Oct 2007 08:57:40 -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 16574-02 for ; Fri, 19 Oct 2007 08:57:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cse.ust.hk (cssvr7.cse.ust.hk [143.89.41.157]) by postgresql.org (Postfix) with ESMTP id 80C1F9FA1FE for ; Fri, 19 Oct 2007 08:57:36 -0300 (ADT) Received: from LENOVO098A0F97 (laptopgw.cse.ust.hk [143.89.41.237]) (authenticated bits=0) by cse.ust.hk (8.13.8/8.12.5) with ESMTP id l9JBvVf5012512 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Fri, 19 Oct 2007 19:57:32 +0800 From: "Yinan Li" To: Subject: how to improve the performance of creating index Date: Fri, 19 Oct 2007 19:57:32 +0800 Message-ID: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C7_01C8128A.49AF9650" X-Mailer: Microsoft Office Outlook 12.0 thread-index: AcgSRznM3HsjLlQjT6aBDpbv7gtVeA== Content-Language: zh-cn X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/226 X-Sequence-Number: 27248 UbJGR;7b MIME 8qJ=5D6`2?7VSJ<~!# ------=_NextPart_000_01C7_01C8128A.49AF9650 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi, all 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? All helps are appreciated. Thanks. Yinan ------=_NextPart_000_01C7_01C8128A.49AF9650 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi, all

 

  &n= bsp;      I am trying to improve the performance of creating = index.

  &n= bsp;      I’ve set shared_buffers =3D 1024MB

  &n= bsp;           &nb= sp;    Effective_cache_size =3D 1024MB

  &n= bsp;           &nb= sp;    Work_mem =3D 1GB

  &n= bsp;           &nb= sp;    Maintenance_work_mem=3D512MB

  &n= bsp;      (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?

All helps are appreciated.

 

Thanks.

Yinan

------=_NextPart_000_01C7_01C8128A.49AF9650-- From heikki@enterprisedb.com Fri Oct 19 12:05:08 2007 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 From cbbrowne@acm.org Fri Oct 19 13:05:33 2007 Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 2B9259FA180 for ; Fri, 19 Oct 2007 10:05:33 -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 87097-02-5 for ; Fri, 19 Oct 2007 10:05:31 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id BBA689FA0BA for ; Fri, 19 Oct 2007 10:05:31 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id l9JD5PW9034585 for ; Fri, 19 Oct 2007 10:05:25 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id l9JD40DI029276 for pgsql-performance@postgresql.org; Fri, 19 Oct 2007 10:04:00 -0300 (ADT) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.performance Subject: Re: how to improve the performance of creating index Date: Fri, 19 Oct 2007 08:52:05 -0400 Organization: cbbrowne Computing Inc Lines: 34 Message-ID: <60hckngtca.fsf@dba2.int.libertyrms.com> References: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.20 (linux) Cancel-Lock: sha1:d4q5LyFenA9+IR0QOlrKRDoF4H4= To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/228 X-Sequence-Number: 27250 yinanli@cse.ust.hk ("Yinan Li") writes: >          I am trying to improve the performance of creating index.:p> > >          I've set shared_buffers = 1024MB:p> > >                    Effective_cache_size = 1024MB:p> > >                    Work_mem = 1GB:p> > >                    Maintenance_work_mem=512MB:p> > >          (I'm sure that the server process has received the SIGHUP signal):p> > > 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?:p> > > All helps are appreciated.:p> Those values seem rather large, with the exception of the effective cache size, which I would expect to be somewhat bigger, based on the other values. Note that the values for work_mem and maintenance_work_mem get used each time something is sorted or maintained. So if those values get set high, this can pretty easily lead to scary amounts of swapping, which would tend to lead to things getting "very slow." You may want to do a census as to how much resources you have on the server. Knowing that would help people make more rational evaluations of whether your parameters are sensible or not. -- (reverse (concatenate 'string "moc.enworbbc" "@" "enworbbc")) http://linuxdatabases.info/info/languages.html All syllogisms have three parts, therefore this is not a syllogism. From heikki@enterprisedb.com Fri Oct 19 14:51:50 2007 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 From scott.marlowe@gmail.com Fri Oct 19 18:21:36 2007 Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id EA6E49FC509 for ; Fri, 19 Oct 2007 15:21:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 89980-02 for ; Fri, 19 Oct 2007 15:21:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 3B3B49FC50E for ; Fri, 19 Oct 2007 15:21:27 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so645225ugf for ; Fri, 19 Oct 2007 11:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=pfWLm/jCYgr32u27b7Eh1Eayfu3etWL/iPdTHAyT6GE=; b=eL9z01778bCaNzQjNYxD/UpBFTuonVkIJ1dbcwzbjmsNLrUo39PKDvS7SJ65ajEnkViNEmu0bF6T/3rD/8RmaXHHzrrH61v8AB+df83hvTEefWScA1AP/tkczXjWb0U8Rudbkooxy+8jCC3gkeV4jSFU3zBuBBDPa9gnqKX/wfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Kt1zRndYs7n4eAr839vzIh5GEs0ClLK7KANmhIjyqZ8AofDMK+3rQpdRg/ZIH374/b3wFJbqQE8CQr9YVaIdyRaCeWWxQnESPp/0KkSQZ14Y774mQO3AyQnp3J81t6+mmzlInnPyqHqp4SYigzTcBShe5eds97rH2O1AQr4d4IQ= Received: by 10.66.252.8 with SMTP id z8mr3320169ugh.1192818086530; Fri, 19 Oct 2007 11:21:26 -0700 (PDT) Received: by 10.67.29.6 with HTTP; Fri, 19 Oct 2007 11:21:26 -0700 (PDT) Message-ID: Date: Fri, 19 Oct 2007 13:21:26 -0500 From: "Scott Marlowe" To: "Yinan Li" Subject: Re: how to improve the performance of creating index Cc: pgsql-performance@postgresql.org In-Reply-To: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <01c601c81247$3b8c5650$b2a502f0$@ust.hk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/234 X-Sequence-Number: 27256 On 10/19/07, Yinan Li wrote: > > Hi, all > 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, exactly is the create index statement? I assume that if there's only two columns then at worst it's a two part index (i.e. column1, column2) which can get rather large.