Re: Parallel INSERT (INTO ... SELECT ...)

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "Tang, Haiying" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>
Subject: Re: Parallel INSERT (INTO ... SELECT ...)
Date: 2021-02-24 09:03:46
Message-ID: CAA4eK1+DQ4Kjuc2rnPzi4kMaKeFYic+n66d91kxWsj76Cq9HqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 24, 2021 at 2:14 PM Greg Nancarrow <gregn4422(at)gmail(dot)com> wrote:
>
> On Wed, Feb 24, 2021 at 3:12 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Wed, Feb 24, 2021 at 8:41 AM Greg Nancarrow <gregn4422(at)gmail(dot)com> wrote:
> > >
> > > On Tue, Feb 23, 2021 at 10:53 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > > >
> > > > > But the non-parallel plan was chosen (instead of a parallel plan)
> > > > > because of parallel-safety checks on the partitions, which found
> > > > > attributes of the partitions which weren't parallel-safe.
> > > > > So it's not so clear to me that the dependency doesn't exist - the
> > > > > non-parallel plan does in fact depend on the state of the partitions.
> > > > >
> > > >
> > > > Hmm, I think that is not what we can consider as a dependency.
> > > >
> > >
> > > Then if it's not a dependency, then we shouldn't have to check the
> > > attributes of the partitions for parallel-safety, to determine whether
> > > we must use a non-parallel plan (or can use a parallel plan).
> > > Except, of course, we do have to ...
> > >
> >
> > I don't think the plan-dependency and checking for parallel-safety are
> > directly related.
> >
>
> That is certainly not my understanding. Why do you think that they are
> not directly related?
> This whole issue came about because Amit L pointed out that there is a
> need to add partition OIDs as plan-dependencies BECAUSE the checking
> for parallel-safety and plan-dependency are related - since now, for
> Parallel INSERT, we're executing extra parallel-safety checks that
> check partition properties, so the resultant plan is dependent on the
> partitions and their properties.
>

He has pointed out an issue when the plan is parallel and you can see
in that example that it fails if we didn't invalidate it. For
non-parallel plans, there won't be any such issue.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2021-02-24 09:11:44 Re: [BUG] segfault during delete
Previous Message Kyotaro Horiguchi 2021-02-24 09:01:02 Re: Is Recovery actually paused?