Re: [sqlsmith] Failed assertion in postgres_fdw/deparse.c:1116

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Andreas Seltenreich <seltenreich(at)gmx(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [sqlsmith] Failed assertion in postgres_fdw/deparse.c:1116
Date: 2016-06-08 07:29:15
Message-ID: CAFjFpRd0QXYrzQx2wRC+SsO41zOZ-M8HH0hpsTt8Cdpdy9nF1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 8, 2016 at 12:25 PM, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
> wrote:

> On 2016/06/08 14:13, Ashutosh Bapat wrote:
> > On Tue, Jun 7, 2016 at 6:19 PM, Amit Langote wrote:
> >> On Tue, Jun 7, 2016 at 7:47 PM, Ashutosh Bapat wrote:
> >>> Looks good to me. If we add a column from the outer relation, the
> >> "NULL"ness
> >>> of inner column would be more clear. May be we should tweak the query
> to
> >>> produce few more rows, some with non-NULL columns from both the
> >> relations.
> >>> Also add a note to the comment in the test mentioning that such a join
> >> won't
> >>> be pushed down for a reader to understand the EXPLAIN output. Also, you
> >>> might want to move that test, closer to other un-pushability tests.
> >>
> >> Done in the attached. Please check if my comment explains the reason
> >> of push-down failure correctly.
> >
> > On further thought, I think we need to restrict the join pushdown only
> for
> > outer joins. Only those joins can produce NULL rows. If we go with that
> > change, we will need my changes as well and a testcase with inner join.
>
> I think the added test in foreign_join_ok() would restrict only the outer
> joins from being pushed down (and further, only those with placeholdervars
> in their targetlist being referred to above their level). Do you have any
> query handy as example where unintended push-down failure occurs?
>
>
Right, PHVs are created in case of outer joins. So, for an inner join the
list will not have anything in there for it.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-06-08 08:01:07 Re: Reviewing freeze map code
Previous Message Amit Langote 2016-06-08 06:55:59 Re: [sqlsmith] Failed assertion in postgres_fdw/deparse.c:1116