Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B95D41337B39 for ; Wed, 19 Jan 2011 16:04:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11217-02 for ; Wed, 19 Jan 2011 20:04:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 63EFC1337B84 for ; Wed, 19 Jan 2011 16:04:25 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p0JK4MG28021; Wed, 19 Jan 2011 15:04:22 -0500 (EST) From: Bruce Momjian Message-Id: <201101192004.p0JK4MG28021@momjian.us> Subject: Re: anti-join chosen even when slower than old plan In-Reply-To: <11745.1289580185@sss.pgh.pa.us> To: Tom Lane Date: Wed, 19 Jan 2011 15:04:22 -0500 (EST) CC: Robert Haas , =?ISO-8859-1?Q?C=E9dric_Villemain?= , Kevin Grittner , Mladen Gogala , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UNKNOWN-8BIT" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/176 X-Sequence-Number: 41963 Tom Lane wrote: > Robert Haas writes: > > On Fri, Nov 12, 2010 at 4:15 AM, Cédric Villemain > > wrote: > >>> I wondering if we could do something with a formula like 3 * > >>> amount_of_data_to_read / (3 * amount_of_data_to_read + > >>> effective_cache_size) = percentage NOT cached.  That is, if we're > >>> reading an amount of data equal to effective_cache_size, we assume 25% > >>> caching, and plot a smooth curve through that point.  In the examples > >>> above, we would assume that a 150MB read is 87% cached, a 1GB read is > >>> 50% cached, and a 3GB read is 25% cached. > > >> But isn't it already the behavior of effective_cache_size usage ? > > > No. > > I think his point is that we already have a proven formula > (Mackert-Lohmann) and shouldn't be inventing a new one out of thin air. > The problem is to figure out what numbers to apply the M-L formula to. > > I've been thinking that we ought to try to use it in the context of the > query as a whole rather than for individual table scans; the current > usage already has some of that flavor but we haven't taken it to the > logical conclusion. Is there a TODO here? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +