<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pg_stat_bgwriter on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/pg_stat_bgwriter/</link><description>Recent content in Pg_stat_bgwriter on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Thu, 02 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/pg_stat_bgwriter/index.xml" rel="self" type="application/rss+xml"/><item><title>Identify Insert-Only Tables in PostgreSQL</title><link>https://www.postgresscripts.com/post/identify-insert-only-tables-in-postgresql/</link><pubDate>Thu, 02 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/identify-insert-only-tables-in-postgresql/</guid><description>
&lt;h2 id="identify-insert-only-tables-in-postgresql-using-pg_stat_user_tables"&gt;Identify Insert-Only Tables in PostgreSQL Using pg_stat_user_tables&lt;/h2&gt;
&lt;p&gt;Not all PostgreSQL tables behave the same way. Most application tables have a mix of inserts, updates, and deletes. A minority of tables receive only inserts. These append-only tables — event logs, audit trails, sensor readings, message queues — have fundamentally different storage and maintenance characteristics.&lt;/p&gt;
&lt;p&gt;A DBA who treats an insert-only table the same as a general-purpose table will misconfigure autovacuum, miss partitioning opportunities, and misread bloat signals. The starting point is knowing which tables are insert-only. PostgreSQL tracks per-table DML counts in &lt;code&gt;pg_stat_user_tables&lt;/code&gt;, and a simple query against that view identifies them.&lt;/p&gt;</description></item></channel></rss>