RE: Parallel Inserts in CREATE TABLE AS

From: "Tang, Haiying" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Luc Vlaming <luc(at)swarm64(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
Subject: RE: Parallel Inserts in CREATE TABLE AS
Date: 2021-01-25 03:10:30
Message-ID: 36077faff589447b8134842110317f02@G08CNEXMBPEKD05.g08.fujitsu.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>Thanks a lot for the tests. In your test case, parallel insertions are not being picked because the Gather node has
> some projections(floor(((random() * '10000'::double precision) + >'1'::double precision)) to perform. That's expected.
>Whenever parallel insertions are chosen for CTAS, we should see "Create target_table '' under Gather node [1] and
>also the actual >row count for Gather node 0 (but in your test it is rows=100006268) in the explain analyze output.
>Coming to your test case, if it's modified to something like [1], where the Gather >node has no projections,
>then parallel insertions will be chosen.

Thanks for your explanation and test.
Actually, I deliberately made my test case(with projection) to pick serial insert to make tuples unbalance distribution(99% tuples read by one worker) happened.
This issue will lead the performance regression.

But it's not introduced by your patch, it’s happening in master(HEAD).
Do you have some thoughts about this.

>[1] - I did this test on my development system, I will run on some performance system and post my observations.

Thank you, It will be very kind of you to do this.
To reproduce above issue, you need to use my case(with projection). Because it won’t occur in “parallel insert”.

Regards,
Tang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-01-25 03:12:53 Re: Is Recovery actually paused?
Previous Message Amit Kapila 2021-01-25 02:58:22 Re: Single transaction in the tablesync worker?