Re: Parallel Inserts in CREATE TABLE AS

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Inserts in CREATE TABLE AS
Date: 2020-11-25 02:40:49
Message-ID: CALj2ACUaPbR8OvKHap1g2wW5vzKjYomj0rVn=cu+R6N4nHOY6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 24, 2020 at 4:43 PM Hou, Zhijie <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com> wrote:
>
> I'm very interested in this feature,
> and I'm looking at the patch, here are some comments.
>

Thanks for the review.

>
> How about the following style:
>
> if(TupIsNull(outerTupleSlot))
> Break;
>
> (void) node->ps.dest->receiveSlot(outerTupleSlot, node->ps.dest);
> node->ps.state->es_processed++;
>
> Which looks cleaner.
>

Done.

>
> The check can be replaced by ISCTAS(into).
>

Done.

>
> 'inerst' looks like a typo (insert).
>

Corrected.

>
> The code here call strlen(intoclausestr) for two times,
> After checking the existing code in ExecInitParallelPlan,
> It used to store the strlen in a variable.
>
> So how about the following style:
>
> intoclause_len = strlen(intoclausestr);
> ...
> /* Store serialized intoclause. */
> intoclause_space = shm_toc_allocate(pcxt->toc, intoclause_len + 1);
> memcpy(shmptr, intoclausestr, intoclause_len + 1);
> shm_toc_insert(pcxt->toc, PARALLEL_KEY_INTO_CLAUSE, intoclause_space);
>

Done.

>
> The two check about intoclausestr seems can be combined like:
>
> if (intoclausestr != NULL)
> {
> ...
> }
> else
> {
> ...
> }
>

Done.

Attaching v5 patch. Please consider it for further review.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v5-0001-Parallel-Inserts-in-CREATE-TABLE-AS.patch application/x-patch 43.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Seino Yuki 2020-11-25 03:02:38 Re: [PATCH] Add features to pg_stat_statements
Previous Message Kyotaro Horiguchi 2020-11-25 02:39:39 Re: Strange behavior with polygon and NaN