X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B4DC99DCBB3 for ; Wed, 1 Mar 2006 15:25:48 -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 74522-01 for ; Wed, 1 Mar 2006 15:25:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 71CC09DC863 for ; Wed, 1 Mar 2006 15:25:46 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 7E29D56459; Wed, 1 Mar 2006 13:25:32 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Wed, 1 Mar 2006 13:25:32 -0600 Date: Wed, 1 Mar 2006 13:25:32 -0600 From: "Jim C. Nasby" To: Vincent Chen Cc: pgsql-admin@postgresql.org Subject: Re: PostgreSQL performance tuning Message-ID: <20060301192532.GM82012@pervasive.com> References: <20060225132231.74100.qmail@web35802.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060225132231.74100.qmail@web35802.mail.mud.yahoo.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060301:vctw@yahoo.com::UShTrqD7saTaXv+l:00005H9 X-Hashcash: 1:20:060301:pgsql-admin@postgresql.org::eVNwHFcHQLqFBVLF:00000000000 0000000000000000000000000dtB X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200603/13 X-Sequence-Number: 20770 On Sat, Feb 25, 2006 at 09:22:31PM +0800, Vincent Chen wrote: > > Hi, all > > I have a postgresql 7.4 running on mandriva linux 10.1 with 512M RAM & AMD > 2000+ CPU. I increased system share memory to 128M, buffer to 64M, sort memory > to 32M. A single query do finish much faster. Now I need to analyze some weekly > data involving hundred queries with 'group by order by' operation. Total data > less than 250M, but did take some time to complete. How can I tune my system to > handle a lot of concurrent quries at the same time and do it faster? > > BTW, upgrade hardware is not an option at this time. ;> The challenge is making sure you don't make the OS start swapping, which will destroy performance. If there's some queries where substantially more sort memory would help and you can control how many of those run at once, you might be able to increase sort_memory more for just those queries. (Easiest to put the queries in a transaction and do a SET LOCAL). Also, you should absolutely upgrade to 8.1 if at all possible. Some folks have seen performance more than double, depending on the workload. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461