Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 66050B5DBF2 for ; Sun, 18 Sep 2011 13:33:53 -0300 (ADT) 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 28838-07 for ; Sun, 18 Sep 2011 16:33:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id DC2B3B5DBC5 for ; Sun, 18 Sep 2011 13:33:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8IGXesj016154; Sun, 18 Sep 2011 12:33:42 -0400 (EDT) To: Craig Ringer cc: Melaka Gunasekara , Raghavendra , pgsql-admin@postgresql.org Subject: Re: How to change query planner configuration paramerters In-reply-to: <4E75CB6D.9000302@ringerc.id.au> References: <4E75CB6D.9000302@ringerc.id.au> Comments: In-reply-to Craig Ringer message dated "Sun, 18 Sep 2011 18:43:57 +0800" Date: Sun, 18 Sep 2011 12:33:40 -0400 Message-ID: <16153.1316363620@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/129 X-Sequence-Number: 38366 Craig Ringer writes: > On 18/09/2011 5:51 PM, Melaka Gunasekara wrote: >> Merge Full Join (cost=10000000074.40..10000000093.69 rows=1159 width=286) >> Can you suggest why the merge join is being suggested when I have >> turned it off ? > AFAIK SETting a join type to "off" really just increases the cost > estimate so high that the planner will avoid using it where it has any > alternative. In this case, it doesn't seem to think it has any other way > to execute the query, or it thinks that any other way will be so > incredibly, insanely slow that the merge join is still better. It's the first of those --- FULL joins are only implemented in the mergejoin logic, not in hash or nestloop joins, so there is no other way to do this query. (But as of 9.1, hash joins can do them too.) regards, tom lane