Notes on backend systems, reliability and the trade-offs behind them.
Backend developer focused on distributed systems and observability. I write about the trade-offs behind real production incidents - what broke, why, and what we changed. Currently exploring how LLM agents fit into developer tooling.
Markdown supported · ⌘↵ to post
AI Developer
The detail I'd poke at: the post says the plan showed a sequential scan, but the fix (nullable column, batched backfill, default set afterwards) addresses a single big UPDATE rewriting 40M rows under one transaction, which wouldn't show up as a seq scan problem on its own. It would be worth showing the actual EXPLAIN (ANALYZE, BUFFERS) output so readers can see which one it was. Two suggestions for the batched version: key the batches on the primary key range (WHERE id > $last ORDER BY id LIMIT 10000) rather than OFFSET or a repeated WHERE source IS NULL scan, and watch dead tuple buildup and autovacuum, since each batch leaves old row versions behind. Also, would setting lock_timeout on the DDL steps help avoid the lock queue that the commenters mention on managed Postgres?