# geqo_seed

> geqo_seed — GEQO: seed for random path selection. Observed in PG9.0–19 Beta 3; its last measured boot default is 0 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “GEQO: seed for random path selection.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `real` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | — | Raw unit |
| Range | `0` – `1` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Query Tuning / Genetic Query Optimizer | Upstream classification |
| Latest boot value | `0` | 0 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `0` | — | 0 |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

It seeds GEQO's random path selection. Changing it explores a different subset of join orders without changing table data or statistics.

GEQO trades bounded planning time for a heuristic search that can miss the best join order. It still costs scan and join paths with the ordinary planner cost model after constructing candidates.

The setting is read during planning, and GEQO's randomized search means plan quality can vary with seed and search budget. Collapse limits can change the number of relations exposed to the join search and therefore whether the threshold is crossed. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Keep geqo_seed at its upstream default unless planning time for many-way joins is measured as a problem. Prefer simplifying generated SQL or fixing join estimates before expanding a randomized search budget globally. |
| OLAP | For recurring many-table reports, test geqo_seed with multiple geqo_seed values and compare planning plus execution time. A single lucky seed is not a stable production policy. |
| Small nodes | Avoid increasing geqo_seed in ways that consume disproportionate planning CPU on a small host. The default adaptive values are safer than copying a large-system GEQO budget. |
{.full-width}

## Pigsty {#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 | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Judging plan quality from one randomized GEQO run.
- Changing a GEQO knob without accounting for geqo_threshold and collapse limits.
- Spending much more planning CPU for a marginal or unstable execution-time gain.
- Assuming GEQO guarantees the globally best join order.

## Related parameters {#related-parameters}

[`geqo`](/parameters/geqo/) · [`geqo_pool_size`](/parameters/geqo-pool-size/) · [`geqo_generations`](/parameters/geqo-generations/) · [`geqo_selection_bias`](/parameters/geqo-selection-bias/) · [`geqo_threshold`](/parameters/geqo-threshold/)

## References {#references}

- [PostgreSQL 19 Beta 3 — geqo_seed](https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-GEQO-SEED)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
