<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Postgres on Joe Bylund</title><link>http://jbylund.github.io/tags/postgres/</link><description>Recent content in Postgres on Joe Bylund</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Joe Bylund</copyright><lastBuildDate>Mon, 07 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="http://jbylund.github.io/tags/postgres/index.xml" rel="self" type="application/rss+xml"/><item><title>The ILIKE Trap: 40ms of Planning for 3ms of Work</title><link>http://jbylund.github.io/posts/00384_ilike-trap-postgres-planner/</link><pubDate>Mon, 07 Sep 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00384_ilike-trap-postgres-planner/</guid><description>ILIKE on a trigram-indexed column was spending ~40ms in the query planner for every ~3ms of execution. The fix was two lines of SQL and one line of Python — but finding it required understanding what the planner actually does with ILIKE.</description></item><item><title>Scryfall Sorts Alphabetically. I Sort by CubeCobra Popularity.</title><link>http://jbylund.github.io/posts/00288_card-preference-scoring-function/</link><pubDate>Mon, 24 Aug 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00288_card-preference-scoring-function/</guid><description>Search results need two distinct scoring concerns: which printing of a card to surface, and which cards to rank first. Both are numeric ORDER BY expressions baked into the card rows.</description></item><item><title>22 Indexes on One Table: How Card Search Uses Every Index Type PostgreSQL Has</title><link>http://jbylund.github.io/posts/00224_postgres-index-strategies/</link><pubDate>Tue, 11 Aug 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00224_postgres-index-strategies/</guid><description>The magic.cards table carries indexes of every type PostgreSQL offers. A tour of trigram GIN for substring search, GIN for JSONB containment, B-tree for numerics, hash for exact-match fields, and an expression index that unlocks a color identity query that otherwise requires a full table scan.</description></item><item><title>PostgreSQL COPY Loading: Faster Bulk Import</title><link>http://jbylund.github.io/posts/00160_postgres-copy-loading/</link><pubDate>Tue, 28 Jul 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00160_postgres-copy-loading/</guid><description>Switching from row-by-row inserts to PostgreSQL&amp;rsquo;s COPY protocol meaningfully cut import time. Why COPY is fast, how to stream data into it from Python, and two approaches to expanding a JSON blob into a typed row.</description></item><item><title>One Query, Two Answers: How NOT MATERIALIZED Lets Each Branch Pick Its Own Index</title><link>http://jbylund.github.io/posts/00144_results-and-count-single-query/</link><pubDate>Tue, 21 Jul 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00144_results-and-count-single-query/</guid><description>A search endpoint needs paginated results and a total count. A single CTE with UNION ALL answers both — and for deduplicated searches it runs in roughly half the time. For non-deduplicated searches it matches two separate queries while using one round trip.</description></item><item><title>Compiling a Query AST to Parameterized SQL</title><link>http://jbylund.github.io/posts/00128_compiling-ast-to-sql/</link><pubDate>Tue, 14 Jul 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00128_compiling-ast-to-sql/</guid><description>Each AST node emits a SQL fragment and bound parameters. How the node hierarchy works, how different field types generate different SQL, and why user input never touches the query string. Covers text/regex/arithmetic; JSONB operators and the count+results CTE are in separate posts.</description></item><item><title>The Query Scryfall Can't Answer: `power+toughness&gt;cmc+cmc`</title><link>http://jbylund.github.io/posts/00032_why-build-a-self-hosted-scryfall/</link><pubDate>Sat, 20 Jun 2026 00:00:00 +0000</pubDate><guid>http://jbylund.github.io/posts/00032_why-build-a-self-hosted-scryfall/</guid><description>Motivation for building Sylvan Librarian: owning the query language, and the killer feature Scryfall can&amp;rsquo;t do — arithmetic comparisons across card attributes.</description></item></channel></rss>