{"Entry":{"collection":"guc","key":"parallel_leader_participation","name":"parallel_leader_participation","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Worker Processes","category_zh":"","changed_in":["14","18"],"changes":[{"documentation_changed":false,"fields":{},"from":"10","status":"added","to":"11"},{"documentation_changed":false,"fields":{"extra_desc":{"from":"Should gather nodes also run subplans, or just gather tuples?","to":"Should gather nodes also run subplans or just gather tuples?"}},"from":"13","status":"changed","to":"14"},{"documentation_changed":false,"fields":{"category":{"from":"Resource Usage / Asynchronous Behavior","to":"Resource Usage / Worker Processes"}},"from":"17","status":"changed","to":"18"}],"content_hash":"693be5b43c8ad8eace3469836ea77ba9802c39e693981671480df96427b13e35","context":"","default_changed_in":[],"default_history":[{"from":"11","to":"19","value":"on"}],"editorial":{"advice":{"olap":"For CPU-heavy subplans, leader participation often adds useful execution capacity; for very large result streams, disabling it can let the leader drain workers sooner. Compare both boolean states on the same plan and concurrency level.","oltp":"Keep the default on unless a representative Gather plan shows that the leader is too busy executing the subplan to consume worker tuples promptly. Test off only at session scope and compare first-row latency, total latency, and worker blocking.","small":"This boolean does not add or remove worker slots. Leave it on unless measurements show a result-consumption bottleneck; size worker counts separately with max_parallel_workers_per_gather and the shared pools."},"mechanism":["parallel_leader_participation controls whether the process above Gather or Gather Merge also runs the parallel subplan while coordinating workers. With it off, the leader focuses on reading worker output.","Leader participation can add useful CPU when result production is expensive, but a leader busy executing the subplan may be slower to consume a large worker result stream.","The value is a planning/execution policy for eligible parallel plans, not an extra worker slot. Its effect depends on tuple volume, Gather versus Gather Merge, worker availability, and where the bottleneck lies. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Treating the boolean as a degree-of-parallelism or worker-count setting.","Speaking of a 'larger' value when the only choices are on and off.","Disabling participation without measuring the extra wait before workers produce the first tuples.","Enabling participation without checking whether the leader then drains a large worker result stream too slowly."],"references":[{"title":"PostgreSQL 19 Beta 4: parallel_leader_participation","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-PARALLEL-LEADER-PARTICIPATION"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_parallel_workers_per_gather","max_parallel_workers","enable_gathermerge","parallel_tuple_cost","parallel_setup_cost"],"summary":"parallel_leader_participation — Controls whether Gather and Gather Merge also run subplans. Observed in PG11–19 Beta 4; its last measured boot default is on in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"11","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.809422+08:00","intro_commit":{"authored_at":"2017-11-15T08:17:29-05:00","discussion":["https://postgr.es/m/CAEepm=2U++Lp3bNTv2Bv_kkr5NE2pOyHhxU=G0YTa4ZhSYhHiw@mail.gmail.com"],"hash":"e5253fdc4f5fe2f38aec47e08c6aee93f934183d","subject":"Add parallel_leader_participation GUC.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e5253fdc4f5fe2f38aec47e08c6aee93f934183d"},"key":"parallel_leader_participation","last_version":"20","max_val":"","min_val":"","name":"parallel_leader_participation","position":306,"present_in":["11","12","13","14","15","16","17","18","19","20"],"short_desc":"Allows the leader process to execute the query plan under Gather and Gather Merge nodes instead of waiting for worker processes.","short_desc_zh":"","source_rev":"english-manuals:538511fdf8e77b3139233af18c5904719e609b635aabbfbedc510edb0b3252a9","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"parallel_leader_participation","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"parallel_leader_participation","SourceRevision":"english-manuals:538511fdf8e77b3139233af18c5904719e609b635aabbfbedc510edb0b3252a9","Facts":{"boot_val":"on","category":"Resource Usage / Worker Processes","context":"user","description":"Allows the leader process to execute the query plan under Gather and Gather Merge nodes instead of waiting for worker processes. The default is on. Setting this value to off reduces the likelihood that workers will become blocked because the leader is not reading tuples fast enough, but requires the leader process to wait for worker processes to start up before the first tuples can be produced. The degree to which the leader can help or hinder performance depends on the plan type, number of workers and query duration.","doc":{"anchor":"GUC-PARALLEL-LEADER-PARTICIPATION","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"Should gather nodes also run subplans or just gather tuples?","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"parallel_leader_participation","short_desc":"Controls whether Gather and Gather Merge also run subplans.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-PARALLEL-LEADER-PARTICIPATION","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"parallel_leader_participation","SourceDatabase":"center","Version":"18","Locale":"en","Title":"parallel_leader_participation","Summary":"Allows the leader process to execute the query plan under Gather and Gather Merge nodes instead of waiting for worker processes. The default is on. Setting this value to off reduces the likelihood that workers will become blocked because the leader is not reading tuples fast enough, but requires the leader process to wait for worker processes to start up before the first tuples can be produced. The degree to which the leader can help or hinder performance depends on the plan type, number of workers and query duration.","BodyHTML":"\u003cp\u003eAllows the leader process to execute the query plan under Gather and Gather Merge nodes instead of waiting for worker processes. The default is on. Setting this value to off reduces the likelihood that workers will become blocked because the leader is not reading tuples fast enough, but requires the leader process to wait for worker processes to start up before the first tuples can be produced. The degree to which the leader can help or hinder performance depends on the plan type, number of workers and query duration.\u003c/p\u003e","SourceRevision":"english-manuals:538511fdf8e77b3139233af18c5904719e609b635aabbfbedc510edb0b3252a9","ContentHash":"e7b17255f895c552b25bf7619472e045bcd047b84d3e964de247ff8964d4e25d","Payload":{"description":"Allows the leader process to execute the query plan under Gather and Gather Merge nodes instead of waiting for worker processes. The default is on. Setting this value to off reduces the likelihood that workers will become blocked because the leader is not reading tuples fast enough, but requires the leader process to wait for worker processes to start up before the first tuples can be produced. The degree to which the leader can help or hinder performance depends on the plan type, number of workers and query duration."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
