# autovacuum_worker_slots

> autovacuum_worker_slots — Sets the number of backend slots to allocate for autovacuum workers. Observed in PG18–19 Beta 3; its last measured boot default is 16 in PG19 Beta 3, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Sets the number of backend slots to allocate for autovacuum workers.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | — | Raw unit |
| Range | `1` – `262143` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Vacuuming / Automatic Vacuuming | Upstream classification |
| Latest boot value | `16` | 16 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG18 |
| Present in | PG18–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`c758119e5bfb`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c758119e5bfb47b38cf957f9a5a37ceae96fa9b3) — Allow changing autovacuum_max_workers without restarting. |
| Commit date | 2025-01-06 |
| Discussion | [thread 1](https://postgr.es/m/20240410212344.GA1824549%40nathanxps13) |

## Default history {#default-history}

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

## How it works {#mechanism}

Sets the number of backend slots to allocate for autovacuum workers. The value is fixed when the server starts, so changing it requires a restart.

PG18 separates the startup allocation of backend slots for autovacuum workers from the active concurrency limit autovacuum_max_workers. The slots are reserved at startup so the worker limit can be reloaded within that allocation.

Monitor and change autovacuum_worker_slots together with autovacuum, autovacuum_naptime, autovacuum_max_workers. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Tune autovacuum_worker_slots from table size, change rate, and maintenance SLA, using per-table thresholds for large/hot relations. Observe trigger intervals, dead tuples, and ANALYZE/VACUUM duration. |
| OLAP | Run explicit ANALYZE/VACUUM after bulk loads instead of waiting only for proportional triggers; plan freezing and visibility-map advancement separately for append-only partitions. |
| Small nodes | Start with upstream or the measured Pigsty matrix value. Fixed thresholds dominate on small tables; after changes, confirm worker and I/O headroom. |
{.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: PG18–19 Beta 3 unmodified; OLAP: PG18–19 Beta 3 unmodified; CRIT: PG18–19 Beta 3 unmodified; TINY: PG18–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Changing the global value while a table storage parameter overrides it.
- Treating reltuples and cumulative change statistics as exact real-time counts.
- Blaming a threshold without checking long transactions, replication slots, and worker saturation.
- Buying short-term quiet by deferring maintenance until wraparound failsafe activates.

## Related parameters {#related-parameters}

[`autovacuum`](/parameters/autovacuum/) · [`autovacuum_naptime`](/parameters/autovacuum-naptime/) · [`autovacuum_max_workers`](/parameters/autovacuum-max-workers/) · [`autovacuum_work_mem`](/parameters/autovacuum-work-mem/) · [`track_counts`](/parameters/track-counts/) · [`autovacuum_analyze_scale_factor`](/parameters/autovacuum-analyze-scale-factor/)

## References {#references}

- [PostgreSQL 19 Beta 3 — autovacuum_worker_slots](https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM-WORKER-SLOTS)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
