Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 48B96650259 for ; Wed, 13 Aug 2008 22:48:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 62964-04 for ; Wed, 13 Aug 2008 22:48:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.61.230.242]) by postgresql.org (Postfix) with ESMTP id 0CEC265024D for ; Wed, 13 Aug 2008 22:48:09 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id A65F95C0BA; Thu, 14 Aug 2008 09:48:03 +0800 (WST) Received: from [10.0.0.53] (wallace.localnet [10.0.0.53]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 96BE91E0435; Thu, 14 Aug 2008 09:48:03 +0800 (WST) Message-ID: <48A38ED3.8080500@postnewspapers.com.au> Date: Thu, 14 Aug 2008 09:48:03 +0800 From: Craig Ringer User-Agent: Icedove 1.5.0.14eol (X11/20080509) MIME-Version: 1.0 To: "Decibel!" Cc: Chris Kratz , pgsql-performance@postgresql.org Subject: Re: Incorrect estimates on correlated filters References: <3642025c0808121459x75c8d9baq66194b87f5053ea3@mail.gmail.com> <12707C41-48C3-4072-A152-46FAB1FEE1E2@decibel.org> In-Reply-To: <12707C41-48C3-4072-A152-46FAB1FEE1E2@decibel.org> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/164 X-Sequence-Number: 31045 Decibel! wrote: > Well... you could try and convince certain members of the community that > we actually do need some kind of a query hint mechanism... ;) It strikes me that there are really two types of query hint possible here. One tells the planner (eg) "prefer a merge join here". The other gives the planner more information that it might not otherwise have to work with, so it can improve its decisions. "The values used in this join condition are highly correlated". Is there anything wrong with the second approach? It shouldn't tend to suppress planner bug reports etc. Well, not unless people use it to lie to the planner, and I expect results from that would be iffy at best. It just provides information to supplement Pg's existing stats system to handle cases where it's not able to reasonably collect the required information. -- Craig Ringer