pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: Re: pgsql: Further fixes for degenerate outer join clauses.
Date: Wed, 12 Aug 2015 15:18:02 -0400
Message-ID: <55CB9BEA.4030103@dunslane.net> (raw)
In-Reply-To: <E1ZNQxR-00072N-0D@gemulon.postgresql.org>
References: <E1ZNQxR-00072N-0D@gemulon.postgresql.org>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>



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



view thread (17+ messages)  latest in thread

Message-ID: <55CB9BEA.4030103@dunslane.net>
Permalink:  ../55CB9BEA.4030103@dunslane.net/
Also on:    postgresql.org/message-id/55CB9BEA.4030103@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Further fixes for degenerate outer join clauses.
  In-Reply-To: <55CB9BEA.4030103@dunslane.net>
  References: <E1ZNQxR-00072N-0D@gemulon.postgresql.org> <55CB9BEA.4030103@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox