{"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"}],"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"],"short_desc":"Sets the maximum number of workers that the cluster can support for parallel operations.","short_desc_zh":"","source_rev":"english-manuals:ee554f671470db7dc4cbe6773d2d266a8095eb6a6cc48e779f3ad362e7400dfc","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_parallel_workers","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_parallel_workers","SourceRevision":"english-manuals:ee554f671470db7dc4cbe6773d2d266a8095eb6a6cc48e779f3ad362e7400dfc","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.","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","unit":null,"vartype":"integer"},"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":"pgweb","Version":"18","Locale":"zh-Hans","Title":"max_parallel_workers","Summary":"","BodyHTML":"\u003cp\u003e设置集簇能够为并行操作提供的工作进程的最大数量。默认值为 8。增大或减小此值时，也应考虑调整\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-MAINTENANCE-WORKERS\" rel=\"nofollow\"\u003emax_parallel_maintenance_workers\u003c/a\u003e、\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER\" rel=\"nofollow\"\u003emax_parallel_workers_per_gather\u003c/a\u003e。此外，将此值设得大于\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\" rel=\"nofollow\"\u003emax_worker_processes\u003c/a\u003e没有效果，因为并行工作进程取自该设置建立的工作进程池。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"2cb3e71fede90d4d9a7bd465deb6537c129105cee48c954d49887989276c5c4c","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置集簇能够为并行操作提供的工作进程的最大数量。默认值为 8。增大或减小此值时，也应考虑调整\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-MAINTENANCE-WORKERS\"\u003emax_parallel_maintenance_workers\u003c/a\u003e、\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER\"\u003emax_parallel_workers_per_gather\u003c/a\u003e。此外，将此值设得大于\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"\u003emax_worker_processes\u003c/a\u003e没有效果，因为并行工作进程取自该设置建立的工作进程池。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","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}
