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: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Luc Vlaming <luc(at)swarm64(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Zhihong Yu <zyu(at)yugabyte(dot)com>
Subject: Re: Parallel Inserts in CREATE TABLE AS
Date: 2020-12-22 07:02:43
Message-ID: CALj2ACUdNvK0RPWE5Er8HhinSRtyGfmubK8gQdxsvtabwbe2ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 21, 2020 at 8:16 AM Hou, Zhijie <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com> wrote:
> The cfbost seems complains about the testcase:
>
> Command exited with code 1
> perl dumpregr.pl
> === $path ===\ndiff -w -U3 C:/projects/postgresql/src/test/regress/expected/write_parallel.out C:/projects/postgresql/src/test/regress/results/write_parallel.out
> --- C:/projects/postgresql/src/test/regress/expected/write_parallel.out 2020-12-21 01:41:17.745091500 +0000
> +++ C:/projects/postgresql/src/test/regress/results/write_parallel.out 2020-12-21 01:47:20.375514800 +0000
> @@ -1204,7 +1204,7 @@
> -> Gather (actual rows=2 loops=1)
> Workers Planned: 3
> Workers Launched: 3
> - -> Parallel Seq Scan on temp2 (actual rows=0 loops=4)
> + -> Parallel Seq Scan on temp2 (actual rows=1 loops=4)
> Filter: (col2 < 3)
> Rows Removed by Filter: 1
> (14 rows)
> @@ -1233,7 +1233,7 @@
> -> Gather (actual rows=2 loops=1)
> Workers Planned: 3
> Workers Launched: 3
> - -> Parallel Seq Scan on temp2 (actual rows=0 loops=4)
> + -> Parallel Seq Scan on temp2 (actual rows=1 loops=4)
> Filter: (col2 < 3)
> Rows Removed by Filter: 1
> (14 rows)

Thanks! Looks like the explain analyze test case outputs can be
unstable because we may not get the requested number of workers
always. The comment before explain_parallel_append function in
partition_prune.sql explains it well.

Solution is to have a function similar to explain_parallel_append, say
explain_parallel_inserts in write_parallel.sql and use that for all
explain analyze cases. This will make the results consistent.
Thoughts? If okay, I will update the test cases and post new patches.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tang, Haiying 2020-12-22 07:04:34 RE: [POC] Fast COPY FROM command for the table with foreign partitions
Previous Message Michael Paquier 2020-12-22 06:47:57 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly