Skip to content

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

Type , Valuereal
Upstream pg_settings type
Context , Valueuser
Settable by an ordinary user
Unit , Value
Raw unit
Range , Value01e+10
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueClient Connection Defaults / Statement Behavior
Upstream classification
Latest boot value , Value0.1
0.1

Lifecycle

Fact Value
First observed PG11
Present in PG11–13
Removed in PG14
Introduction commit 857f9c36cda5 — Skip full index scan during cleanup of B-tree indexes when possible
Commit date 2018-04-04
Discussion thread 1

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG11–13 0.1 0.1

How it works

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

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.

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
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

  • 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.

autovacuum · autovacuum_vacuum_scale_factor · vacuum_cost_limit · vacuum_cost_delay · maintenance_work_mem · autovacuum_work_mem

References