Configuration parameter

max_parallel_workers_per_gather — PostgreSQL Configuration Parameter

Category Parallelism Default 2 Unit boolean / enum / numeric Change scope Per-session (SET)

Max parallel workers a single Gather node can use.

At a glance

Property Value
Parameter max_parallel_workers_per_gather
Category Parallelism
Default 2
Value type boolean / enum / numeric
Change scope Per-session (SET)

What it does

Maximum number of parallel worker processes a single query node may launch. 0 disables parallel query for the session.

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW max_parallel_workers_per_gather; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'max_parallel_workers_per_gather';.

Tuning guidance

Raise (4-8) for analytical/reporting workloads on multi-core servers; keep modest for high-concurrency OLTP so many queries do not each grab workers. Bounded by max_parallel_workers and max_worker_processes.

Reference

PostgreSQL documentation — Parallelism configuration.

Was this helpful?

← All configuration parameters