Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPbXc-0005BP-Kg for pgsql-committers@arkaria.postgresql.org; Wed, 12 Aug 2015 19:18:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZPbXb-0002BO-J7 for pgsql-committers@arkaria.postgresql.org; Wed, 12 Aug 2015 19:18:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPbXQ-0001y6-7m for pgsql-committers@postgresql.org; Wed, 12 Aug 2015 19:18:12 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZPbXM-00028L-W5 for pgsql-committers@postgresql.org; Wed, 12 Aug 2015 19:18:11 +0000 Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id C3793FB87E; Wed, 12 Aug 2015 21:18:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 7pDWt5B2QfNz; Wed, 12 Aug 2015 21:18:04 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id CE3AFFB86E; Wed, 12 Aug 2015 21:18:03 +0200 (CEST) Subject: Re: pgsql: Further fixes for degenerate outer join clauses. To: Tom Lane , pgsql-committers@postgresql.org References: From: Andrew Dunstan Message-ID: <55CB9BEA.4030103@dunslane.net> Date: Wed, 12 Aug 2015 15:18:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 08/06/2015 03:36 PM, Tom Lane wrote: > Further fixes for degenerate outer join clauses. > > Further testing revealed that commit f69b4b9495269cc4 was still a few > bricks shy of a load: minor tweaking of the previous test cases resulted > in the same wrong-outer-join-order problem coming back. After study > I concluded that my previous changes in make_outerjoininfo() were just > accidentally masking the problem, and should be reverted in favor of > forcing syntactic join order whenever an upper outer join's predicate > doesn't mention a lower outer join's LHS. This still allows the > chained-outer-joins style that is the normally optimizable case. > > I also tightened things up some more in join_is_legal(). It seems to me > on review that what's really happening in the exception case where we > ignore a mismatched special join is that we're allowing the proposed join > to associate into the RHS of the outer join we're comparing it to. As > such, we should *always* insist that the proposed join be a left join, > which eliminates a bunch of rather dubious argumentation. The case where > we weren't enforcing that was the one that was already known buggy anyway > (it had a violatable Assert before the aforesaid commit) so it hardly > deserves a lot of deference. > > Back-patch to all active branches, like the previous patch. The added > regression test case failed in all branches back to 9.1, and I think it's > only an unrelated change in costing calculations that kept 9.0 from > choosing a broken plan. Looks like this might have upset brolga on 9.0 and 9.1 - it's coming up with a different plan from what's expected. cheers andrew -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers