X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id A28E211F7DF9 for ; Tue, 18 Apr 2006 20:22:32 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.38 X-Spam-Level: X-Spam-Status: No, score=-2.38 required=5 tests=[AWL=0.219, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id loazuxuLacjZ for ; Tue, 18 Apr 2006 20:22:30 -0300 (ADT) 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 E674711F7DF4 for ; Tue, 18 Apr 2006 20:22:28 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id A447456423; Tue, 18 Apr 2006 18:22:28 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 18 Apr 2006 18:22:26 -0500 Date: Tue, 18 Apr 2006 18:22:26 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Markus Schaber , pgsql-performance@postgresql.org Subject: Re: merge>hash>loop Message-ID: <20060418232226.GO49405@pervasive.com> References: <1145029009.3422.31.camel@spectre.intellivid.com> <10000.1145031205@sss.pgh.pa.us> <1145033149.3422.41.camel@spectre.intellivid.com> <11035.1145033929@sss.pgh.pa.us> <4444C4CF.2000106@logix-tt.com> <19433.1145399208@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19433.1145399208@sss.pgh.pa.us> 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:060418:tgl@sss.pgh.pa.us::j5bMirsmaCManfai:00000000000000000000 0000000000000000000000008dEr X-Hashcash: 1:20:060418:schabi@logix-tt.com::ORUGm7qkFE7wt3yN:000000000000000000 0000000000000000000000008rDX X-Hashcash: 1:20:060418:pgsql-performance@postgresql.org::xj0SEepZvrlhVR6b:00000 0000000000000000000000008SM0 X-Archive-Number: 200604/409 X-Sequence-Number: 18493 On Tue, Apr 18, 2006 at 06:26:48PM -0400, Tom Lane wrote: > Markus Schaber writes: > > Hmm, how does effective_cach_size correspond with it? Shouldn't a high > > effective_cache_size have a similar effect? > > It seems reasonable to suppose that effective_cache_size ought to be > used as a number indicating how much "stuff" would hang around from > query to query. Right now it's not used that way... Maybe it would be a reasonable first pass to have estimators calculate the cost if a node found everything it wanted in cache and then do a linear interpolation between that and the costs we currently come up with? Something like pg_class.relpages / sum(pg_class.relpages) would give an idea of how much of a relation is likely to be cached, which could be used for the linear interpolation. Of course having *any* idea as to how much of a relation was actually in shared_buffers (or better yet, the OS cache) would be a lot more accurate, but this simple method might be a good enough first-pass. -- 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