{"Entry":{"collection":"guc","key":"max_parallel_workers","name":"max_parallel_workers","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Worker Processes","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"9.6","status":"added","to":"10"},{"documentation_changed":true,"fields":{},"from":"10","status":"changed","to":"11"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"category":{"from":"Resource Usage / Asynchronous Behavior","to":"Resource Usage / Worker Processes"}},"from":"17","status":"changed","to":"18"}],"content_hash":"85fd7534aff4be73c25bdd68ade1ca7012fd339662d459243afdf00f31e079e3","context":"","default_changed_in":[],"default_history":[{"from":"10","to":"19","value":"8"}],"derived_content_hash":"43cabb4b26711127c72fb8f5d5e743d21d0ea9ec4a868b8daa2f5daa345d1a03","editorial":{"advice":{"olap":"Analytical work can use a larger max_parallel_workers, but multiply per-node memory and I/O by concurrent statements. Benchmark throughput under realistic worker contention rather than one isolated query.","oltp":"Set max_parallel_workers from a concurrency budget, not core count alone. Protect latency-sensitive OLTP from report and maintenance bursts, and verify actual Workers Planned versus Workers Launched.","small":"Keep max_parallel_workers conservative on a small host. More possible workers can reduce throughput through context switching and memory pressure even when a single query becomes faster."},"mechanism":["max_parallel_workers caps the cluster-wide number of workers simultaneously active for parallel query and maintenance. It is a pool ceiling beneath max_worker_processes.","Per-operation parameters request workers from this pool, but no slots are reserved. A plan can start with fewer workers than planned, and concurrent jobs can starve each other.","Increasing it expands potential CPU, memory, and I/O concurrency; it does not itself make plans parallel. Planner thresholds, safety checks, and max_parallel_workers_per_gather still govern query choices. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Treating max_parallel_workers as reserved capacity rather than an upper bound shared with other work.","Ignoring that parallel plans multiply CPU, I/O, and work_mem-limited nodes.","Benchmarking one query without concurrent worker contention.","Assuming planned workers will always be launched at execution time."],"references":[{"title":"PostgreSQL 19 Beta 4: max_parallel_workers","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_worker_processes","max_parallel_workers_per_gather","max_parallel_maintenance_workers","parallel_setup_cost","parallel_leader_participation"],"summary":"max_parallel_workers — Sets the maximum number of parallel workers that can be active at one time. Observed in PG10–19 Beta 4; its last measured boot default is 8 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"10","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.714932+08:00","intro_commit":{"authored_at":"2016-12-02T07:42:58-05:00","discussion":[],"hash":"b460f5d6693103076dc554aa7cbb96e1e53074f9","subject":"Add max_parallel_workers GUC.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b460f5d6693103076dc554aa7cbb96e1e53074f9"},"key":"max_parallel_workers","last_version":"20","max_val":"","min_val":"","name":"max_parallel_workers","position":275,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:ee554f671470db7dc4cbe6773d2d266a8095eb6a6cc48e779f3ad362e7400dfc","receipt_sha256":"38887854a2fe1c12ed18baaeb059050fe47e922719b690a9267f03638fb03656","repair":"wiki-repair-20261023"},"short_desc":"Sets the maximum number of workers that the cluster can support for parallel operations.","short_desc_zh":"","source_rev":"wiki-repair-20261023:10b8d168ec5bfbc98038a5d79699033090afcd5d95cc882e1d39ba4f12b91bf1","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_parallel_workers","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_parallel_workers","SourceRevision":"wiki-repair-20261023:10b8d168ec5bfbc98038a5d79699033090afcd5d95cc882e1d39ba4f12b91bf1","Facts":{"boot_val":"8","category":"Resource Usage / Worker Processes","context":"user","description":"Sets the maximum number of workers that the cluster can support for parallel operations. The default value is 8. When increasing or decreasing this value, consider also adjusting max_parallel_maintenance_workers and max_parallel_workers_per_gather. Also, note that a setting for this value which is higher than max_worker_processes will have no effect, since parallel workers are taken from the pool of worker processes established by that setting.","description_zh":"设置集簇能够为并行操作提供的工作进程的最大数量。默认值为 8。增大或减小此值时，也应考虑调整 max_parallel_maintenance_workers、max_parallel_workers_per_gather。此外，将此值设得大于 max_worker_processes 没有效果，因为并行工作进程取自该设置建立的工作进程池。","description_zh_html":"\u003cp\u003e\n        设置集簇能够为并行操作提供的工作进程的最大数量。默认值为 8。增大或减小此值时，也应考虑调整 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-MAINTENANCE-WORKERS\"\u003emax_parallel_maintenance_workers\u003c/a\u003e、\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER\"\u003emax_parallel_workers_per_gather\u003c/a\u003e。此外，将此值设得大于 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"\u003emax_worker_processes\u003c/a\u003e 没有效果，因为并行工作进程取自该设置建立的工作进程池。\n       \u003c/p\u003e","doc":{"anchor":"GUC-MAX-PARALLEL-WORKERS","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"1024","metadata_version":"18","min_val":"0","name":"max_parallel_workers","short_desc":"Sets the maximum number of parallel workers that can be active at one time.","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":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-PARALLEL-WORKERS","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_parallel_workers","SourceDatabase":"center","Version":"18","Locale":"en","Title":"max_parallel_workers","Summary":"Sets the maximum number of workers that the cluster can support for parallel operations. The default value is 8. When increasing or decreasing this value, consider also adjusting max_parallel_maintenance_workers and max_parallel_workers_per_gather. Also, note that a setting for this value which is higher than max_worker_processes will have no effect, since parallel workers are taken from the pool of worker processes established by that setting.","BodyHTML":"\u003cp\u003eSets the maximum number of workers that the cluster can support for parallel operations. The default value is 8. When increasing or decreasing this value, consider also adjusting max_parallel_maintenance_workers and max_parallel_workers_per_gather. Also, note that a setting for this value which is higher than max_worker_processes will have no effect, since parallel workers are taken from the pool of worker processes established by that setting.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:10b8d168ec5bfbc98038a5d79699033090afcd5d95cc882e1d39ba4f12b91bf1","ContentHash":"7ff3793479d361de0e57db67796b44e94cfa8dbb20edf3aaf5fd1c7299a376cd","Payload":{"description":"Sets the maximum number of workers that the cluster can support for parallel operations. The default value is 8. When increasing or decreasing this value, consider also adjusting max_parallel_maintenance_workers and max_parallel_workers_per_gather. Also, note that a setting for this value which is higher than max_worker_processes will have no effect, since parallel workers are taken from the pool of worker processes established by that setting."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
