Technologies/PostgreSQL/table_bloat
PostgreSQLPostgreSQLMetric

table_bloat

Table bloat percentage
Dimensions:None
Available on:DatadogDatadog (1)
Interface Metrics (1)
DatadogDatadog
Enabled with `collect_bloat_metrics`. The estimated percentage of table bloat. This metric is tagged with db, schema, table.
Dimensions:None

Technical Annotations (31)

Configuration Parameters (7)
autovacuum_vacuum_threshold
Minimum number of updated/deleted tuples before autovacuum triggers
autovacuum_vacuum_scale_factor
Fraction of table size used to calculate autovacuum trigger threshold
autovacuum_max_workers
Maximum number of concurrent autovacuum processes
autovacuum_naptime
Time between autovacuum runs on each database
fillfactorrecommended: lower than 100
controls space left on each page for HOT updates to stay on same page
autovacuum_vacuum_cost_delay
Controls delay between vacuum cost limit checks to optimize performance
autovacuum_vacuum_cost_limit
Sets cost limit before autovacuum sleeps to balance performance impact
CLI Commands (11)
VACUUMremediation
SELECT relname, n_live_tup, n_dead_tup, pg_size_pretty(pg_total_relation_size(oid)) FROM pg_stat_user_tables WHERE schemaname = 'public';diagnostic
VACUUM FULL table_name;remediation
ANALYZEremediation
EXPLAIN ANALYZEdiagnostic
VACUUM FULLremediation
CLUSTERremediation
TRUNCATEremediation
SELECT relname AS table, n_dead_tup AS dead_rows FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 10;diagnostic
SELECT name, setting FROM pg_settings WHERE name LIKE 'autovacuum%';diagnostic
VACUUM ANALYZE your_table_name;remediation
Technical References (13)
autovacuumcomponenttransaction ID wraparoundconceptdead tuplesconceptpgwatchcomponentVACUUMcomponentVACUUM FULLcomponentpg_stat_user_tablescomponentHOT updatesconceptpg_repackcomponentpg_squeezecomponentfillfactorcomponentMVCCconcepttable bloatconcept
Related Insights (11)
Inefficient autovacuum configuration causes table bloat and transaction ID wraparound riskcritical
Index and table bloat wastes disk space and degrades query performancewarning
Dead tuples accumulate massively when autovacuum is blocked from cleanupcritical
Bloated tables with dead rows skew performance metrics and waste storagewarning
Data locality degradation causes excessive buffer reads over timewarning
Blocked autovacuum allows unbounded bloat accumulationcritical
HOT update conditions not met causes heap bloatwarning
Large tables miss autovacuum due to scale factor defaultswarning
Table bloat from insufficient vacuuming requires VACUUM FULLwarning
Dead tuples exceed threshold causing table and index bloatwarning
High autovacuum duration causes table bloat and performance degradationwarning