Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5EC7E1337B4A for ; Wed, 16 Feb 2011 17:22:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 23075-03 for ; Wed, 16 Feb 2011 21:22:47 +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 860DA133616B for ; Wed, 16 Feb 2011 17:22:46 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p1GLMQS29138; Wed, 16 Feb 2011 16:22:26 -0500 (EST) From: Bruce Momjian Message-Id: <201102162122.p1GLMQS29138@momjian.us> Subject: Re: Why we don't want hints Was: Slow count(*) again... In-Reply-To: <4D53CA4F020000250003A789@gw.wicourts.gov> To: Kevin Grittner Date: Wed, 16 Feb 2011 16:22:26 -0500 (EST) CC: sthomas@peak6.com, Josh Berkus , Robert Haas , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" 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: 201102/420 X-Sequence-Number: 42558 Kevin Grittner wrote: > Shaun Thomas wrote: > > > how difficult would it be to add that syntax to the JOIN > > statement, for example? > > Something like this syntax?: > > JOIN WITH (correlation_factor=0.3) > > Where 1.0 might mean that for each value on the left there was only > one distinct value on the right, and 0.0 would mean that they were > entirely independent? (Just as an off-the-cuff example -- I'm not > at all sure that this makes sense, let alone is the best thing to > specify. I'm trying to get at *syntax* here, not particular knobs.) I am not excited about the idea of putting these correlations in queries. What would be more intesting would be for analyze to build a correlation coeffficent matrix showing how columns are correlated: a b c a 1 .4 0 b .1 1 -.3 c .2 .3 1 and those correlations could be used to weigh how the single-column statistics should be combined. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +