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 05B3D9DCC57 for ; Tue, 21 Mar 2006 05:50:52 -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 15201-08 for ; Tue, 21 Mar 2006 05:50:53 -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 7C0929DCB67 for ; Tue, 21 Mar 2006 05:50:49 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 83E8756435; Tue, 21 Mar 2006 03:50:51 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Tue, 21 Mar 2006 03:50:49 -0600 Date: Tue, 21 Mar 2006 03:50:49 -0600 From: "Jim C. Nasby" To: Guillaume Cottenceau Cc: Mark Kirkwood , pgsql-performance@postgresql.org Subject: Re: planner with index scan cost way off actual cost, advices to tweak cost constants? Message-ID: <20060321095049.GW15742@pervasive.com> References: <87ek11gz69.fsf@meuh.mnc.lan> <441CDAAA.20609@paradise.net.nz> <87d5ghms3h.fsf@meuh.mnc.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d5ghms3h.fsf@meuh.mnc.lan> 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:060321:gc@mnc.ch::OpXr9P4V8hdvVlAr:0000000035Mz X-Hashcash: 1:20:060321:markir@paradise.net.nz::L2xdmSAf9yBBpb6y:000000000000000 0000000000000000000000003Iee X-Hashcash: 1:20:060321:pgsql-performance@postgresql.org::cFuKpCu8Ntcls8zs:00000 000000000000000000000000EPOp X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200603/366 X-Sequence-Number: 17803 On Mon, Mar 20, 2006 at 09:35:14AM +0100, Guillaume Cottenceau wrote: > > shared_buffer = 12000 > > effective_cache_size = 25000 > > > > This would mean you are reserving 100M for Postgres to cache relation > > pages, and informing the planner that it can expect ~200M available > > from the disk buffer cache. To give a better recommendation, we need > > Ok, thanks. I wanted to investigate this field, but as the > application is multithreaded and uses a lot of postgres clients, > I wanted to make sure the shared_buffers values is globally for > postgres, not just per (TCP) connection to postgres, before > increasing the value, fearing to take the whole server down. shared_buffer is for the entire 'cluster', not per-connection or per-database. Also, effective_cache_size of 25000 on a 1G machine seems pretty conservative to me. I'd set it to at least 512MB, if not closer to 800MB. -- 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