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

From: Greg Nancarrow <gregn4422(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel INSERT (INTO ... SELECT ...)
Date: 2020-12-09 04:40:52
Message-ID: CAJcOf-eWffFmm7MogorctK7dZhKWi2V-3U1mb25H1gfMLVXvpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 9, 2020 at 1:35 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> Most of the code present in
> v9-0001-Enable-parallel-SELECT-for-INSERT-INTO-.-SELECT.patch is
> applicable for parallel copy patch also. The patch in this thread
> handles the check for PROPARALLEL_UNSAFE, we could slightly make it
> generic by handling like the comments below, that way this parallel
> safety checks can be used based on the value set in
> max_parallel_hazard_context. There is nothing wrong with the changes,
> I'm providing these comments so that this patch can be generalized for
> parallel checks and the same can also be used by parallel copy.

Hi Vignesh,

You are absolutely right in pointing that out, the code was taking
short-cuts knowing that for Parallel Insert,
"max_parallel_hazard_context.max_interesting" had been set to
PROPARALLEL_UNSAFE, which doesn't allow that code to be generically
re-used by other callers.

I've attached a new set of patches that includes your suggested improvements.

Regards,
Greg Nancarrow
Fujitsu Australia

Attachment Content-Type Size
v10-0002-Parallel-SELECT-for-INSERT-INTO-.-SELECT-tests-and-doc.patch application/octet-stream 56.5 KB
v10-0004-Parallel-INSERT-and-or-SELECT-for-INSERT-INTO-tests-and-doc.patch application/octet-stream 19.4 KB
v10-0001-Enable-parallel-SELECT-for-INSERT-INTO-.-SELECT.patch application/octet-stream 21.2 KB
v10-0003-Enable-parallel-INSERT-and-or-SELECT-for-INSERT-INTO.patch application/octet-stream 38.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-12-09 04:46:41 Re: Parallel Inserts in CREATE TABLE AS
Previous Message Michael Paquier 2020-12-09 04:36:04 Re: small cleanup in unicode_norm.c