postgresql.dead_rows
Estimated dead rowsDimensions:None
Interface Metrics (3)
Dimensions:None
Sources
Technical Annotations (44)
Configuration Parameters (9)
autovacuum_vacuum_scale_factorrecommended: 0.05autovacuum_analyze_scale_factorrecommended: 0.005autovacuum_vacuum_cost_delayrecommended: 2autovacuum_max_workersrecommended: 5-6 for high-write workloadsautovacuum_vacuum_thresholdrecommended: 1000idle_in_transaction_session_timeoutrecommended: 30minautovacuum_analyze_thresholdrecommended: 50autovacuum_vacuum_cost_limitrecommended: 1000track_countsrecommended: onCLI Commands (11)
SELECT relname AS table_name, last_analyze, last_autoanalyze, n_live_tup, n_dead_tup, round(100.0 * n_dead_tup / NULLIF(n_live_tup + n_dead_tup, 0), 1) AS dead_pct FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 15;diagnosticALTER TABLE events SET (autovacuum_vacuum_scale_factor = 0.01, autovacuum_analyze_scale_factor = 0.005);remediationVACUUM ANALYZE table_name;remediationSELECT count(*) filter (where state = 'idle in transaction') as idle_in_transaction FROM pg_stat_activity;diagnosticSELECT * FROM pg_stat_user_tables WHERE autovacuum_count > 0;monitoringVACUUM citiesremediationALTER TABLE cities SET (autovacuum_vacuum_scale_factor = 0.01);remediationSELECT schemaname, relname, n_dead_tup, n_live_tup, ROUND((n_dead_tup::float / NULLIF(n_live_tup + n_dead_tup, 0)) * 100, 2) AS dead_tuple_percent, last_autovacuum, autovacuum_count FROM pg_stat_user_tables WHERE n_dead_tup > 1000 ORDER BY n_dead_tup DESC;diagnosticVACUUM FULLremediationCLUSTERremediationTRUNCATEremediationTechnical References (24)
dead tuplesconceptautovacuumcomponentpg_stat_user_tablescomponentn_dead_tupcomponentpg_stat_all_tablescomponentpg_class.relrowscomponentpgwatchcomponentVACUUMcomponentpg_stat_activitycomponenttable bloatconceptMVCCconceptautovacuum daemoncomponentvisibility mapcomponentheapcomponentxminconceptxmaxconceptpg_stat_user_tables_n_dead_tupcomponentautovacuum throttlingconceptvacuum_cost_page_hitcomponentvacuum_cost_page_misscomponentvacuum_cost_page_dirtycomponentautovacuum workerscomponentpg_stat_all_tables.n_dead_tupcomponentpgstattuplecomponentRelated Insights (16)
High dead tuple percentage degrades query performance and bloats tableswarning
▸
High dead tuple ratio causes table bloat and slow querieswarning
▸
High autovacuum scale factor causes 200GB dead row accumulation on 1TB tableswarning
▸
Index and table bloat wastes disk space and degrades query performancewarning
▸
Idle transactions prevent autovacuum and cause table bloatwarning
▸
Table bloat from suboptimal autovacuum settings slows query performancewarning
▸
Autovacuum lag causes table bloat and performance degradationwarning
▸
Autovacuum daemon fails without statistics collection enabledcritical
▸
Index-only scans fail when visibility map has dead rows/pageswarning
▸
Dead tuples accumulation indicates insufficient VACUUM frequencywarning
▸
Dead tuple accumulation causes table bloat and performance degradationwarning
▸
High dead tuple count triggers vacuum alertwarning
▸
Table bloat from insufficient vacuuming requires VACUUM FULLwarning
▸
Pre-PG14 autovacuum throttling limits cleanup to 4-40 MB/s causing backlogwarning
▸
Increasing autovacuum_max_workers without raising cost_limit does not increase cleanup throughputinfo
▸
MVCC dead rows consume disk space and degrade query performancewarning
▸