Number of parallel workers chosen by the optimizer for parallel append - Mailing list pgsql-general

From Laurenz Albe
Subject Number of parallel workers chosen by the optimizer for parallel append
Date
Msg-id d56c6b20ac6e9d7a69f0d695400bd229c203576c.camel@cybertec.at
Whole thread Raw
Responses Re: Number of parallel workers chosen by the optimizer for parallel append  (Michael Lewis <mlewis@entrata.com>)
Re: Number of parallel workers chosen by the optimizer for parallel append  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
I have a partitioned table, each partition has "parallel_workers = 10" set.

  SET max_parallel_workers_per_gather = 8;

  SET enable_partitionwise_aggregate = on;

  EXPLAIN (COSTS OFF)
  SELECT applicant_name, count(ipc_4)
  FROM laurenz.z_flat
  GROUP BY applicant_name;

                      QUERY PLAN                    
  --------------------------------------------------
   Gather
     Workers Planned: 4
     ->  Parallel Append
           ->  HashAggregate
                 Group Key: z_flat_3.applicant_name
                 ->  Seq Scan on xyz_4 z_flat_3
           ->  HashAggregate
                 Group Key: z_flat.applicant_name
                 ->  Seq Scan on xyz_1 z_flat
           [8 more such partition scans]
  (33 rows)

How does the optimizer decide to use 4 parallel workers?

No matter what I try, I cannot influence that number.

Yours,
Laurenz Albe




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: INSERT Trigger to check for existing records : Does this do what I hope it is doing?
Next
From: Mats Julian Olsen
Date:
Subject: postgres_fdw insert extremely slow