Blog

Thoughts on software engineering, web development, and technology

S
Sam Lee

When Your Filter Logic Fights Your Archival Logic

A dashboard filter used INNER JOIN on archived records to list items. A separate feature intentionally archived those records for a specific user type. Result: those users saw nothing.

Mar 18, 2026·SQL
S
Sam Lee

How PostgreSQL Actually Runs a Query

A practical mental model for how PostgreSQL reads data, uses shared_buffers and work_mem, and decides when a large query has to spill to disk

Mar 17, 2026·PostgreSQL
S
Sam Lee

Why Index Only Scan Still Hits the Heap

Why PostgreSQL sometimes reads the main table millions of times even when the query plan says Index Only Scan

Mar 16, 2026·PostgreSQL
S
Sam Lee

Why Autovacuum Defaults Stop Working on Large Tables

PostgreSQL's percentage-based autovacuum defaults can look reasonable until the table gets large enough that cleanup happens far too late

Mar 15, 2026·PostgreSQL
S
Sam Lee

Why My Analytics Dashboard Showed No Data

A bulk insert pipeline was skipping callbacks, which left key analytics fields blank and turned a small fix into a much larger backfill

Mar 14, 2026·Ruby on Rails
S
Sam Lee

The Day I Finally Used EXPLAIN ANALYZE in Production

A cache clear exposed a slow analytics query, and EXPLAIN ANALYZE finally showed exactly where the time was going

Mar 12, 2026·PostgreSQL
S
Sam Lee

Why Relationship Records Weren't Being Created

A missing relationship record turned out to be a three-layer bug involving dropped metadata, the wrong read path, and a callback that was too narrow

Mar 02, 2026·Ruby on Rails
S
Sam Lee

Why One Dashboard Page Kept 502-ing

A dashboard page kept timing out because one eager-loading call was pulling 156K records into memory for no reason

Feb 09, 2026·Ruby on Rails
S
Sam Lee

The XSS Concern That Wasn't

A code review comment that looked like XSS turned into a useful reminder about ERB escaping and attacker-controlled input

Feb 07, 2026·Ruby on Rails
S
Sam Lee

Flash vs Flash.now: The Rails Gotcha That Finally Made Sense

A simple way to remember when to use flash and when to use flash.now in Rails

Feb 05, 2026·Ruby on Rails

Built by Sam Lee with

 ♥