enable_parallel_hash
Fact — official short description: “Enables the planner’s use of parallel hash plans.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG11 |
| Present in | PG11–19 Beta 3 |
| Removed in | No |
| Introduction commit | 1804284042e6 — Add parallel-aware hash joins. |
| Commit date | 2017-12-20 |
| Discussion | thread 1 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG11–19 Beta 3 | on |
— | on |
How it works
enable_parallel_hash controls whether the planner may choose parallel hash, in which workers cooperate to build and probe a shared hash table.
It is consulted while a plan is built. A session-level change is useful for comparing EXPLAIN alternatives, but an already cached plan is not retroactively rewritten; invalidation or replanning is required to observe a different choice.
It has no effect when enable_hashjoin is off and also depends on a parallel-safe plan and available workers. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Keep the upstream default for routine OLTP. Use a transaction- or session-local change to diagnose whether choosing parallel hash, in which workers cooperate to build and probe a shared hash table explains a regression, then repair statistics, indexes, estimates, or query shape instead of leaving a cluster-wide method ban. |
| OLAP | Benchmark representative analytical plans with and without enable_parallel_hash. Judge planning time, memory, spill, and execution time together; a win for one report is not evidence for a global setting. |
| Small nodes | Do not use enable_parallel_hash as a permanent hint on a small host. Resource pressure may change the best method, so verify with EXPLAIN (ANALYZE, BUFFERS) and keep the change scoped to the affected workload if it is still needed. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG11–19 Beta 3 unmodified; OLAP: PG11–19 Beta 3 unmodified; CRIT: PG11–19 Beta 3 unmodified; TINY: PG11–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Treating enable_parallel_hash as a query hint even though it affects every plan built in its scope.
- Testing an already cached prepared plan and concluding that the setting has no effect.
- Masking stale statistics or cardinality errors by disabling a plan method globally.
- It has no effect when enable_hashjoin is off and also depends on a parallel-safe plan and available workers.
Related parameters
enable_hashjoin · max_parallel_workers_per_gather · work_mem · hash_mem_multiplier