<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Io on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/io/</link><description>Recent content in Io on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Wed, 17 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/io/index.xml" rel="self" type="application/rss+xml"/><item><title>Query PostgreSQL I/O Statistics with pg_stat_io</title><link>https://www.postgresscripts.com/post/query-postgresql-io-statistics-with-pg-stat-io/</link><pubDate>Wed, 17 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/query-postgresql-io-statistics-with-pg-stat-io/</guid><description>
&lt;h2 id="query-postgresql-io-statistics-with-pg_stat_io"&gt;Query PostgreSQL I/O Statistics with pg_stat_io&lt;/h2&gt;
&lt;p&gt;An I/O spike that nobody can attribute is a frustrating thing to chase. Was it autovacuum, a checkpoint, a bulk load, or ordinary client queries? Before PostgreSQL 16 the answer required stitching together several partial views; &lt;code&gt;pg_stat_io&lt;/code&gt; gives a single cluster-wide breakdown of reads, writes, extends, and cache activity by backend type and I/O context.&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_io&lt;/code&gt; is a cumulative statistics view that decomposes the server's block I/O along two axes at once. The first is &lt;code&gt;backend_type&lt;/code&gt; — client backends, autovacuum workers, the background writer, the checkpointer, and so on. The second is &lt;code&gt;context&lt;/code&gt; — &lt;code&gt;normal&lt;/code&gt; activity, &lt;code&gt;vacuum&lt;/code&gt;, &lt;code&gt;bulkread&lt;/code&gt;, and &lt;code&gt;bulkwrite&lt;/code&gt;. The cross-product of those two axes is what makes the view powerful: it does not just say &amp;quot;the server did 40 GB of reads,&amp;quot; it says which subsystem did them and under what kind of operation.&lt;/p&gt;</description></item></channel></rss>