Re: [sqlsmith] Crash in apply_projection_to_path

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andreas Seltenreich <seltenreich(at)gmx(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [sqlsmith] Crash in apply_projection_to_path
Date: 2016-04-30 05:59:06
Message-ID: CAA4eK1JchgDyx90KT3eBO1et8c+mG5neSyXV+0NPQv0Ft5CnVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 29, 2016 at 7:33 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> >> On Thu, Apr 28, 2016 at 10:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> I'd be inclined to think that it's silly to build GatherPaths in
advance
> >>> of having finalized the list of partial paths for a rel.
>
> > What's happening here is that to form joinrel, we need to call
> > add_paths_to_joinrel() with both outer and inner relation twice, once
with
> > rel1 as outer relation and rel1 as inner relation and vice versa. So
now
> > the second call to add_paths_to_joinrel() can replace a partial path
which
> > is being referenced by GatherPath generated in first call. I think we
> > should generate gather paths for join rel after both the calls
> > to add_paths_to_joinrel() aka in make_join_rel(). Attached patch on
above
> > lines fixes the problem for me.
>
> make_join_rel is certainly not far enough down the call stack to solve
> this problem. It can, and typically will, be invoked multiple times
> for the same target join relation.
>
> One possible answer is to do it in standard_join_search, just before
> the set_cheapest call for each join relation.
>

Yes, that makes sense to me.

> You'd need to account
> for the issue in GEQO search as well.
>

How about doing it in merge_clump() before calling set_cheapest()?

Yet, another idea could be to create a copy of partial path before passing
it to create_gather_path()?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-04-30 06:58:43 Re: [sqlsmith] Failed assertion in BecomeLockGroupLeader
Previous Message Ian Barwick 2016-04-30 02:06:38 psql: tab completion for \l