<rss xmlns:ns0="http://www.w3.org/2005/Atom" version="2.0"> <channel><title>Stuff about Things</title><description>Fabien's Blog</description><link>https://blog.coelho.net/</link><ns0:link href="https://blog.coelho.net/feed_rss_created.xml" rel="self" type="application/rss+xml" /><language>en</language> <pubDate>Wed, 28 May 2025 09:52:41 -0000</pubDate> <lastBuildDate>Wed, 28 May 2025 09:52:41 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.17.2</generator> <image> <url>None</url> <title>Stuff about Things</title><link>https://blog.coelho.net/</link> </image> <item> <title>Data Loading Performance of Postgres and TimescaleDB</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Data Loading Performance of Postgres and TimescaleDB&lt;/h1&gt;&lt;p&gt;&lt;a href="https://www.postgresql.org/"&gt;Postgres&lt;/a&gt; is the leading feature-full independentopen-source relational database, steadily increasing its popularity over the&lt;a href="https://db-engines.com/en/ranking_trend"&gt;past 5 years&lt;/a&gt;.&lt;a href="https://www.timescale.com/"&gt;TimescaleDB&lt;/a&gt; is a clever extension to Postgreswhich implements time-series related features, including under the hoodautomatic partioning, and more.&lt;/p&gt;&lt;p&gt;Because he knows how I like investigate Postgres (among other things)performance,&lt;a href="https://www.2ndquadrant.com/en/blog/author/simon-riggs/"&gt;Simon Riggs&lt;/a&gt;(&lt;a href="https://www.2ndquadrant.com/"&gt;2ndQuadrant&lt;/a&gt;) prompted me to look at theperformance of loading a lot of data into Postgres and TimescaleDB, so as tounderstand somehow the degraded performance reported in their&lt;a href="https://docs.timescale.com/latest/introduction/timescaledb-vs-postgres"&gt;TimescaleDB vs Postgres&lt;/a&gt;comparison.Simon provided support, including provisioning 2 AWS VMs for a few days each.&lt;/p&gt;</description><link>https://blog.coelho.net/data-loading-performance-of-postgres-and-timescaledb/</link> <pubDate>Fri, 13 Sep 2019 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/data-loading-performance-of-postgres-and-timescaledb/</guid> </item> <item> <title>Choosing Postgres Bloom Index Parameters</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Choosing Postgres Bloom Index Parameters&lt;/h1&gt;&lt;p&gt;&lt;a href="https://www.postgresql.org/docs/current/bloom.html"&gt;Postgres Bloom&lt;/a&gt; is anextension contributed by &lt;em&gt;Teodor Sigaev&lt;/em&gt;, &lt;em&gt;Alexander Korotkov&lt;/em&gt; and&lt;em&gt;Oleg Bartunov&lt;/em&gt; which provides a new index type for integer and text columns.There is some coverage on how to use it and how it works, which is good becausedocumentation is scarse.&lt;/p&gt;</description><link>https://blog.coelho.net/choosing-postgres-bloom-index-parameters/</link> <pubDate>Sun, 11 Dec 2016 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/choosing-postgres-bloom-index-parameters/</guid> </item> <item> <title>Postgres FILLFACTOR for UPDATE</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Postgres &lt;code&gt;FILLFACTOR&lt;/code&gt; for &lt;code&gt;UPDATE&lt;/code&gt;&lt;/h1&gt;&lt;p&gt;This post discusses the performance impact of Postgres &lt;code&gt;FILLFACTOR&lt;/code&gt; tablestorage parameter on an &lt;code&gt;UPDATE&lt;/code&gt; OLTP load.Note that this &lt;code&gt;FILLFACTO&lt;/code&gt;R is indeed the table storage parameter, althoughthere is also an eponymous parameter for indexes.&lt;/p&gt;</description><link>https://blog.coelho.net/postgres-fillfactor-for-update/</link> <pubDate>Sat, 23 Aug 2014 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/postgres-fillfactor-for-update/</guid> </item> <item> <title>Postgres page size for SSD (2)</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Postgres page size for SSD (2)&lt;/h1&gt;&lt;p&gt;I have &lt;a href="postgres-page-size-for-ssd.md"&gt;recently posted&lt;/a&gt; performance figures withvarying page size using &lt;code&gt;pgbench&lt;/code&gt; on SSD, which show a +10% improvement withsmaller 4 kB page size over the default 8 kB page size.&lt;/p&gt;&lt;p&gt;Josh Berkus pointed out that pgbench test uses rather small 100-bytes rows, andthat changing the tuple size might induce a different conclusion.To assess this point, I ran some tests with different row sizes:1 kB, 3 kB, 7 kB and 15 kB.&lt;/p&gt;</description><link>https://blog.coelho.net/postgres-page-size-for-ssd-2/</link> <pubDate>Sun, 17 Aug 2014 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/postgres-page-size-for-ssd-2/</guid> </item> <item> <title>Postgres page size for SSD</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Postgres page size for SSD&lt;/h1&gt;&lt;p&gt;In a &lt;a href="postgres-warmup.md"&gt;previous post&lt;/a&gt;, I have outlinedthe time required by a Postgres database to warm-up from a HDD on a read-onlyload for a database that fits in memory.&lt;/p&gt;&lt;p&gt;In this post, I want to look at write performance on SSD, focusing on the impactof Postgres page size (blocksize), and on checking whether the current 8 kBdefault is relevant.&lt;/p&gt;</description><link>https://blog.coelho.net/postgres-page-size-for-ssd/</link> <pubDate>Fri, 08 Aug 2014 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/postgres-page-size-for-ssd/</guid> </item> <item> <title>DataFiller 2.0.0 is out!</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <description>&lt;h1&gt;DataFiller 2.0.0 is out!&lt;/h1&gt;&lt;p&gt;&lt;a href="https://www.cri.ensmp.fr/people/coelho/datafiller.html"&gt;DataFiller&lt;/a&gt; processes aPostgres database schema file augmented with directives in comments, andgenerates pseudo-random data matching this schema, taking into accountconstraints such as types, but also primary key, unique, foreign keys, not null…&lt;/p&gt;&lt;p&gt;Version 2.0.0 introduces the following new features:&lt;/p&gt;</description><link>https://blog.coelho.net/datafiller-200-is-out/</link> <pubDate>Sun, 23 Mar 2014 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/datafiller-200-is-out/</guid> </item> <item> <title>DataFiller Tutorial</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <description>&lt;h1&gt;DataFiller Tutorial&lt;/h1&gt;&lt;p&gt;This tutorial introduces how to use DataFiller to fill a Postgres database, sayfor testing functionalities and performances.&lt;/p&gt;</description><link>https://blog.coelho.net/datafiller-tutorial/</link> <pubDate>Sun, 01 Dec 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/datafiller-tutorial/</guid> </item> <item> <title>DataFiller 1.1.3 is out!</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <description>&lt;h1&gt;DataFiller 1.1.3 is out!&lt;/h1&gt;&lt;p&gt;I have just released version 1.1.3 of DataFiller.&lt;/p&gt;&lt;p&gt;The Python script processes a Postgres database schema file augmented withdirectives in comments, and generates random data matching this schema, takinginto account constraints such as types, but also primary key, unique, foreignkeys, not null…&lt;/p&gt;</description><link>https://blog.coelho.net/datafiller-113-is-out/</link> <pubDate>Fri, 29 Nov 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/datafiller-113-is-out/</guid> </item> <item> <title>Postgres Archeology</title> <author>Fabien</author> <category>Postgres</category> <category>system</category> <description>&lt;h1&gt;Postgres Archeology&lt;/h1&gt;&lt;p&gt;In a previous post I have ported a Turing Machine (TM) in SQL down to Postgres 7.3.&lt;/p&gt;&lt;p&gt;I report here my fruitless attempts at running previous versions of Postgres ona Debian or Ubuntu Linux.They would not configure and/or compile, at least with the minimal effort I wasready to undergo: writing portable-to-the-future system-dependent C code doesnot work.Basically, the code from 15 years ago is lost unless you run it on a systemfrom 15 years ago, which may require a hardware from 15 years ago as well, ormaybe a VM.&lt;/p&gt;</description><link>https://blog.coelho.net/postgres-archeology/</link> <pubDate>Sun, 01 Sep 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/postgres-archeology/</guid> </item> <item> <title>Turing Machine in SQL (5/5)</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <category>Turing</category> <description>&lt;h1&gt;Turing Machine in SQL (5/5)&lt;/h1&gt;&lt;p&gt;This is the last of five posts on this subject.&lt;/p&gt;&lt;p&gt;In a &lt;a href="turing-sql-5.md"&gt;previous post&lt;/a&gt; I have shown how to build a Turing Machine(TM) in SQL with Postgres using a recursive SQL function.I claimed that this would work with versions of Postgres older than 8.4.In this post, I actually investigate this claim, porting the script down toversion 7.3 on a Debian Linux.Testing the relatively simple SQL script with older versions reminds us of allthe goodies that have been added over the years.&lt;/p&gt;</description><link>https://blog.coelho.net/turing-machine-in-sql-55/</link> <pubDate>Thu, 29 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/turing-machine-in-sql-55/</guid> </item> <item> <title>Turing Machine in SQL (4/5)</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <category>Turing</category> <description>&lt;h1&gt;Turing Machine in SQL (4/5)&lt;/h1&gt;&lt;p&gt;This is the fourth of five posts on this subject.&lt;/p&gt;&lt;p&gt;&lt;a href="turing-sql-1.md"&gt;In&lt;/a&gt; &lt;a href="turing-sql-2.md"&gt;previous&lt;/a&gt; &lt;a href="turing-sql-3.md"&gt;posts&lt;/a&gt;,I have presented different ways of implementing a Turing Machine (TM) in SQLwith Postgres.All three techniques rely on &lt;code&gt;WITH RECURSIVE&lt;/code&gt; to iterate till the TM stops, soas to provide some kind of while construct.&lt;/p&gt;&lt;p&gt;In this post, I get rid of this construct, so that the solution does not requirePostgres 8.4 or later.Obviously there is a trick: I will use a recursive SQL function with sideeffects on a &lt;code&gt;TABLE&lt;/code&gt; to execute the TM.&lt;/p&gt;</description><link>https://blog.coelho.net/turing-machine-in-sql-45/</link> <pubDate>Mon, 26 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/turing-machine-in-sql-45/</guid> </item> <item> <title>Turing Machine in SQL (3/5)</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <category>Turing</category> <description>&lt;h1&gt;Turing Machine in SQL (3/5)&lt;/h1&gt;&lt;p&gt;This is the third of five posts on this subject.&lt;/p&gt;&lt;p&gt;In &lt;a href="turing-sql-1.md"&gt;previous&lt;/a&gt; &lt;a href="turing-sql-2.md"&gt;posts&lt;/a&gt;, I have presented howto implement a Turing Machine (TM) with the tape stored as an &lt;code&gt;ARRAY&lt;/code&gt; or in aseparate &lt;code&gt;TABLE&lt;/code&gt; accessed through SQL functions.In this post the solution is more cleanly relational, with the tape contentsstored in a column of the recursive query, very like&lt;a href="http://wiki.postgresql.org/wiki/Cyclic_Tag_System"&gt;Andrew Gierth’s CTS implementation&lt;/a&gt;.&lt;/p&gt;</description><link>https://blog.coelho.net/turing-machine-in-sql-35/</link> <pubDate>Fri, 23 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/turing-machine-in-sql-35/</guid> </item> <item> <title>Turing Machine in SQL (2/5)</title> <author>Fabien</author> <category>Postgres</category> <category>SQL</category> <category>Turing</category> <description>&lt;h1&gt;Turing Machine in SQL (2/5)&lt;/h1&gt;&lt;p&gt;This is the second of five posts on this subject.&lt;/p&gt;&lt;p&gt;In a &lt;a href="turing-sql-1.md"&gt;previous post&lt;/a&gt; I presented how to implement a TuringMachine (TM) with an ARRAY to store the tape contents.This solution is not really&lt;a href="http://en.wikipedia.org/wiki/Relational_model"&gt;&lt;em&gt;relational&lt;/em&gt;&lt;/a&gt;, so in this postI’ll show how to build a TM with SQL-only functions.&lt;/p&gt;</description><link>https://blog.coelho.net/turing-machine-in-sql-25/</link> <pubDate>Tue, 20 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/turing-machine-in-sql-25/</guid> </item> <item> <title>Turing Machine in SQL (1/5)</title> <author>Fabien</author> <category>Postgres</category> <category>Turing</category> <description>&lt;h1&gt;Turing Machine in SQL (1/5)&lt;/h1&gt;&lt;p&gt;This is the first of five posts on this subject.&lt;/p&gt;&lt;p&gt;&lt;a href="https://www.postgresql.org/"&gt;Postgres&lt;/a&gt; implementation of SQL is&lt;a href="http://en.wikipedia.org/wiki/Turing_completeness"&gt;Turing Complete&lt;/a&gt;, as show by&lt;a href="http://wiki.postgresql.org/wiki/Cyclic_Tag_System"&gt;Andrew Gierth on Postgres wiki&lt;/a&gt;,where a&lt;a href="http://en.wikipedia.org/wiki/Cyclic_tag_system"&gt;Cyclic Tag System (CTS)&lt;/a&gt;, whichis &lt;a href="http://www.complex-systems.com/pdf/15-1-1.pdf"&gt;proven Turing-complete&lt;/a&gt;, isimplemented using &lt;code&gt;WITH RECURSIVE&lt;/code&gt;, a &lt;code&gt;WINDOW&lt;/code&gt; function, &lt;code&gt;CASE&lt;/code&gt; conditionalexpressions and an &lt;code&gt;OUTER JOIN&lt;/code&gt;.Although the proof is sound, there is a long path from a CTS to an actual&lt;a href="http://en.wikipedia.org/wiki/Turing_Machine"&gt;Turing Machine (TM)&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;The first question I want to answer is: how to build a Turing Machine with SQLonly?&lt;/p&gt;&lt;p&gt;The second question I would like to investigate is: What SQL features areactually required to build a relational Turing Machine.For instance, can it be done without &lt;code&gt;WITH RECURSIVE&lt;/code&gt;, &lt;code&gt;WINDOW&lt;/code&gt; functions and&lt;code&gt;OUTER JOIN&lt;/code&gt;? (Teaser for later posts: yes!)&lt;/p&gt;</description><link>https://blog.coelho.net/turing-machine-in-sql-15/</link> <pubDate>Sat, 17 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/turing-machine-in-sql-15/</guid> </item> <item> <title>Postgres Warm-up</title> <author>Fabien</author> <category>Postgres</category> <category>performance</category> <description>&lt;h1&gt;Postgres Warm-up&lt;/h1&gt;&lt;p&gt;A database can take some time to reach good performances, the time necessary toOS and database caches to load the necessary data from the hard disk drive.Here is an example with Postgres, which outlines the long delay incurred(18 minutes), presents a simple model to explain this behavior, and shows how toreduce it significantly (to a few minutes).&lt;/p&gt;</description><link>https://blog.coelho.net/postgres-warm-up/</link> <pubDate>Wed, 14 Aug 2013 00:00:00 +0000</pubDate><source url="https://blog.coelho.net/feed_rss_created.xml">Stuff about Things</source><guid isPermaLink="true">https://blog.coelho.net/postgres-warm-up/</guid> </item> </channel></rss>