X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0AA8132B366 for ; Fri, 22 Oct 2004 00:36:51 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10535-03 for ; Thu, 21 Oct 2004 23:36:39 +0000 (GMT) Received: from cancun.hq.fairnetworks.com (unknown [141.149.165.227]) by svr1.postgresql.org (Postfix) with ESMTP id 07B8E32B2CB for ; Fri, 22 Oct 2004 00:36:41 +0100 (BST) Received: from openratings.com (localhost.localdomain [127.0.0.1]) by cancun.hq.fairnetworks.com (8.12.10/8.12.10) with ESMTP id i9LNafOD028998; Thu, 21 Oct 2004 19:36:41 -0400 Message-ID: <41784809.4070009@openratings.com> Date: Thu, 21 Oct 2004 19:36:41 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-sql Subject: Re: Trouble with explicit joins References: <41783BC7.4040207@openratings.com> <12900.1098401533@sss.pgh.pa.us> In-Reply-To: <12900.1098401533@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/157 X-Sequence-Number: 19260 Tom Lane wrote: >Dmitry Tkach writes: > > >>I suppose, this is because the planner takes the order, in which the >>tables appear in the explicit joins as some kind of a hint to how I want >>that query to be executed, >> >> > >It's not a "hint", it's a requirement. In general, changing the order >in which outer joins are executed changes the results. > >There are some cases in which it is safe to rearrange the order, but >determining this takes close analysis of the join conditions, and we >don't (yet) have any code to do that. So the planner must be >conservative and take your join order as gospel. > > regards, tom lane > > Yeah.. that's what I figured. Are you saying there is no way around it at all? Isn't there a syntax supported to write a left join with implicit joins?