From: | Greg Nancarrow <gregn4422(at)gmail(dot)com> |
---|---|
To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
Cc: | Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(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-10-06 10:42:44 |
Message-ID: | CAJcOf-fg-Xit7M=Fz9d6wLRVR4MJF=Nnd1cAxhyaNrByzEAPhA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Oct 6, 2020 at 9:10 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> But the problem may arise if a partitioned table has foreign table as
> a partition, I think we can not allow parallelism for this case too,
> but it's hard to determine ahead of time whether a table has a foreign
> partition.(See [1] in copy.c)
>
Thanks, I had seen that as a potential issue when scanning the code,
but had forgotten to note it. I'll check your code again.
> >
> > - Added support for before/after statement-level INSERT triggers
> > (can't allow parallel workers to execute these)
> >
>
> I think we can allow parallelism for before statement level-triggers.
> Leader can execute this trigger and go for parallel inserts.
>
My attached patch implements the before/after statement-level trigger
invocation.
(For INSERT INTO ... SELECT... case, it needs to account for parallel
and non-parallel INSERT, and also the fact that, as the patch
currently stands, the leader also participates in a parallel INSERT -
so I found it necessary to invoke those triggers at the Gather node
level in that case).
> How about before row, after row, instead row, new table type triggers?
>
My attached patch does not allow parallel INSERT if there are any
row-level triggers (as the trigger functions could see a different and
unpredictable table state compared to non-parallel INSERT, even if
otherwise parallel-safe).
Regards,
Greg Nancarrow
Fujitsu Australia
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Borisov | 2020-10-06 11:05:42 | Re: Yet another fast GiST build |
Previous Message | Magnus Hagander | 2020-10-06 10:26:26 | Prevent printing "next step instructions" in initdb and pg_upgrade |