{"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"}],"derived_content_hash":"88e01151cae7ac5b4cbf8ac50383cd4763cc6942e72fe71bd3bcdb72cc2528ae","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"],"repair_provenance":{"original_source_revision":"english-manuals:538511fdf8e77b3139233af18c5904719e609b635aabbfbedc510edb0b3252a9","receipt_sha256":"5a6aa2f97f2c197ae976af83084664ade385209b157000e076fa8ad32749e5f6","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:c5cb90aad2a79d7cba27a5a4ed9d8f40c5c3a396ad7c6fcc52b7ae83a36ef67c","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"parallel_leader_participation","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"parallel_leader_participation","SourceRevision":"wiki-repair-20261023:c5cb90aad2a79d7cba27a5a4ed9d8f40c5c3a396ad7c6fcc52b7ae83a36ef67c","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.","description_zh":"允许领导者进程执行 Gather 和 Gather Merge 节点下的查询计划，而不是等待工作进程。默认值为 on。将此值设置为 off，可以降低工作进程因领导者读取元组不够快而被阻塞的可能性，但在产生第一批元组之前，领导者进程必须等待工作进程启动。领导者对性能的帮助或妨碍程度取决于计划类型、工作进程数量和查询持续时间。","description_zh_html":"\u003cp\u003e\n        允许领导者进程执行 \u003ccode class=\"literal\"\u003eGather\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003eGather Merge\u003c/code\u003e 节点下的查询计划，而不是等待工作进程。默认值为 \u003ccode class=\"literal\"\u003eon\u003c/code\u003e。将此值设置为 \u003ccode class=\"literal\"\u003eoff\u003c/code\u003e，可以降低工作进程因领导者读取元组不够快而被阻塞的可能性，但在产生第一批元组之前，领导者进程必须等待工作进程启动。领导者对性能的帮助或妨碍程度取决于计划类型、工作进程数量和查询持续时间。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-resource.html","sha256":"f5fedbf88ec5f973aaf4e525c03e46dda2a2186dabee154e26780da96b2ac85a"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"bool","zh_from":"same-version-pgdoc"},"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":"wiki-repair-20261023:c5cb90aad2a79d7cba27a5a4ed9d8f40c5c3a396ad7c6fcc52b7ae83a36ef67c","ContentHash":"f816adbfd12669f9b26a5ff6858208bd4e6d2668fbe90212a2eb1c5a4b7c5658","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":"en","Fallback":false,"Versions":["11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
