Re: Parallel Inserts in CREATE TABLE AS - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: Parallel Inserts in CREATE TABLE AS
Date
Msg-id CAFiTN-sQz15EKH_UgvHdgsjzP3xyRt668H0=xU0-e+4EP5-CAA@mail.gmail.com
Whole thread Raw
In response to RE: Parallel Inserts in CREATE TABLE AS  ("Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>)
Responses Re: Parallel Inserts in CREATE TABLE AS
List pgsql-hackers
On Thu, Dec 10, 2020 at 3:59 PM Hou, Zhijie <houzj.fnst@cn.fujitsu.com> wrote:
>
> Hi
>
> +               allow = ps && IsA(ps, GatherState) && !ps->ps_ProjInfo &&
> +                               plannedstmt->parallelModeNeeded &&
> +                               plannedstmt->planTree &&
> +                               IsA(plannedstmt->planTree, Gather) &&
> +                               plannedstmt->planTree->lefttree &&
> +                               plannedstmt->planTree->lefttree->parallel_aware &&
> +                               plannedstmt->planTree->lefttree->parallel_safe;
>
> I noticed it check both IsA(ps, GatherState) and IsA(plannedstmt->planTree, Gather).
> Does it mean it is possible that IsA(ps, GatherState) is true but IsA(plannedstmt->planTree, Gather) is false ?
>
> I did some test but did not find a case like that.
>

This seems like an extra check.  Apart from that if we combine 0001
and 0002 there should be an additional protection so that it should
not happen that in cost_gather we have ignored the parallel tuple cost
and now we are rejecting the parallel insert. Probably we should add
an assert.


-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [Patch] Optimize dropping of relation buffers using dlist
Next
From: Neil Chen
Date:
Subject: Re: Proposed patch for key managment