DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Resource Usage / Worker Processes

parallel_leader_participation

Controls whether Gather and Gather Merge also run subplans. Should gather nodes also run subplans or just gather tuples?

  • Default: on
  • Type: bool
  • Applies: Session (any user)

In plain words

In a parallel query, the original session (the leader) starts workers and collects their results. With this on (default), the leader also does part of the scanning while it waits. Off means it only coordinates.

For DBAs and operators

On is usually best, especially when few workers are available: the leader's share of scanning makes up for missing workers. (In either setting, if no worker can be launched, the leader runs the whole plan itself.) Turning it off can help when the leader is the bottleneck, e.g. Gather Merge with many workers where the leader must merge sorted streams fast enough, or when its own scanning delays reading the tuple queues and workers block on full queues. It also makes timing more predictable for testing. The planner accounts for it: with participation on, the leader counts as roughly a fraction of a worker in cost estimates (its share shrinks as workers increase).

How to change it

Any user can change it for their session with SET.

See it in context

Parallel query Parallel and background workers

Related parameters

max_parallel_workers_per_gather parallel_tuple_cost

All Resource Usage parameters