Skip to content

pg_bloat_cause

Explains why dead rows are not being cleaned up and records diagnostic history

pg_bloat_cause · Explains why dead rows are not being cleaned up and records diagnostic history

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102287pg_bloat_causepg_bloat_cause0.7.0ADMINPostgreSQLSQL

PostgreSQL · 14, 15, 16, 17, 18

Usage

Sources:

pg_bloat_cause 0.7.0 diagnoses why dead rows are not being removed, using PostgreSQL catalog and statistics evidence. It is pure SQL, tested on PostgreSQL 14–19rc1, with superuser installation and no preload or restart.

Read a Diagnosis

CREATE EXTENSION pg_bloat_cause;
SELECT * FROM bloat_cause_text();

Findings distinguish pinned cleanup horizons, ineffective autovacuum and non-HOT update pressure. They are estimates and observations, not an exact physical bloat measurement. A logical slot’s catalog_xmin holds catalog cleanup rather than automatically pinning ordinary user-table rows. Action helpers present commands for operator review and do not execute repairs.

Permissions, History and Alerts

Readers need explicit view/function grants and pg_read_all_stats to inspect other sessions. Sampling, pruning and NOTIFY functions also need write permissions on their history and alert tables. An external scheduler must call them; no worker is installed. Capturing holder query text is opt-in and may retain secrets. Restore the relevant roles and grants with the extension’s application history.

Table reader