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

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel INSERT (INTO ... SELECT ...)
Date: 2020-09-24 02:27:07
Message-ID: CA+hUKG+pRgX7tJZMgTGYeKmgMYWspUkmik6-C8CktNsCfZEOFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 22, 2020 at 4:56 PM Greg Nancarrow <gregn4422(at)gmail(dot)com> wrote:
> Gather (cost=0.00..16.00 rows=9999 width=12) (actual
> time=69.870..70.310 rows=0 loops=1)
> Workers Planned: 5
> Workers Launched: 5
> -> Parallel Insert on primary_tbl (cost=0.00..16.00 rows=500
> width=12) (actual time=59.948..59.949 rows=0 loops=6)

Nice. I took it for a quick spin. I was initially surprised to see
Gather. I suppose I thought that Parallel {Insert|Update|Delete}
might be a top level node itself, because in such a plan there is no
need to gather tuples per se. I understand exactly why you have it
that way though: Gather is needed to control workers and handle their
errors etc, and we don't want to have to terminate parallelism anyway
(thinking of some kind of plan with multiple write subqueries).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-09-24 02:38:18 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message Andres Freund 2020-09-24 02:21:17 Re: Parallel INSERT (INTO ... SELECT ...)