# vacuum_cleanup_index_scale_factor

> vacuum_cleanup_index_scale_factor is the PostgreSQL setting that defines the number of tuple inserts prior to index cleanup as a fraction of reltuples.
---

> [!NOTE]
> **Fact — official short description:** “Number of tuple inserts prior to index cleanup as a fraction of reltuples.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `real` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | — | Raw unit |
| Range | `0` – `1e+10` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Client Connection Defaults / Statement Behavior | Upstream classification |
| Latest boot value | `0.1` | 0.1 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG11 |
| Present in | PG11–13 |
| Removed in | PG14 |
| Introduction commit | [`857f9c36cda5`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=857f9c36cda520030381bd8c2af20adf0ce0e1d4) — Skip full index scan during cleanup of B-tree indexes when possible |
| Commit date | 2018-04-04 |
| Discussion | [thread 1](https://www.postgresql.org/message-id/flat/CAD21AoAX+d2oD_nrd9O2YkpzHaFr=uQeGr9s1rKC3O4ENc568g@mail.gmail.com) |

## Default history {#default-history}

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

## How it works {#mechanism}

vacuum_cleanup_index_scale_factor sets the number of tuple inserts prior to index cleanup as a fraction of reltuples. The PostgreSQL 11–13 knob delayed index cleanup after inserts; it was removed in PostgreSQL 14 when the index-cleanup decision model changed.

vacuum_cleanup_index_scale_factor is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.

The legacy decision applied to B-tree cleanup scans and interacted with VACUUM statistics, inserted tuples, reusable index pages, and autovacuum scheduling; it was not a GIN control.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Do not tune vacuum_cleanup_index_scale_factor for a current server: PostgreSQL removed it in 14. On PostgreSQL 11–13, change it only for a measured index-cleanup problem and plan the upgrade behavior. |
| OLAP | For legacy bulk-load systems, measure actual index maintenance rather than carrying this removed knob forward as configuration folklore. |
| Small nodes | Leave the legacy default and upgrade; a removed parameter is not a durable way to manage small-node vacuum cost. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG13; 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: PG11–13 unmodified; OLAP: PG11–13 unmodified; CRIT: PG11–13 unmodified; TINY: PG11–13 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Changing vacuum_cleanup_index_scale_factor in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
- Applying an old B-tree cleanup heuristic without measuring index scans, reusable pages, and VACUUM behavior on the exact release.
- Confusing a removed session default with current autovacuum thresholds or per-table storage parameters.
- Keeping an unknown-parameter line during a PostgreSQL 14+ upgrade.

## Related parameters {#related-parameters}

[`autovacuum`](/parameters/autovacuum/) · [`autovacuum_vacuum_scale_factor`](/parameters/autovacuum-vacuum-scale-factor/) · [`vacuum_cost_limit`](/parameters/vacuum-cost-limit/) · [`vacuum_cost_delay`](/parameters/vacuum-cost-delay/) · [`maintenance_work_mem`](/parameters/maintenance-work-mem/) · [`autovacuum_work_mem`](/parameters/autovacuum-work-mem/)

## References {#references}

- [PostgreSQL 13 — vacuum_cleanup_index_scale_factor](https://www.postgresql.org/docs/12/runtime-config-client.html#GUC-VACUUM-CLEANUP-INDEX-SCALE-FACTOR)
- [Machine-readable GUC export](/data/guc.jsonl)
