<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dead Tuples on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/dead-tuples/</link><description>Recent content in Dead Tuples on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Sun, 12 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/dead-tuples/index.xml" rel="self" type="application/rss+xml"/><item><title>Monitor Last VACUUM Runs with pg_stat_user_tables</title><link>https://www.postgresscripts.com/post/postgresql-last-vacuum-standalone/</link><pubDate>Sun, 12 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/postgresql-last-vacuum-standalone/</guid><description>
&lt;h2 id="monitor-last-vacuum-runs-with-pg_stat_user_tables"&gt;Monitor Last VACUUM Runs with pg_stat_user_tables&lt;/h2&gt;
&lt;p&gt;A table's dead tuple count climbing while &lt;code&gt;last_autovacuum&lt;/code&gt; stays weeks old isn't noise — it's the clearest sign autovacuum is falling behind, and &lt;a href="https://www.postgresql.org/docs/current/monitoring-stats.html"&gt;pg_stat_user_tables&lt;/a&gt; is where that gap becomes visible in a single query, without tailing logs or guessing at a schedule.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="7945792173"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;pg_stat_user_tables&lt;/code&gt; is a cumulative statistics view: one row per user table, holding scan counts, tuple counts, and maintenance timestamps that accumulate for the life of the server (or since the last &lt;code&gt;pg_stat_reset()&lt;/code&gt;). The view carries columns for two distinct maintenance operations in the same row — VACUUM and ANALYZE — but they trigger independently, run on different thresholds, and carry different operational risk. Conflating them in a single audit muddies the signal.&lt;/p&gt;</description></item></channel></rss>