bit rot

notes of a backend developer — postgres, python, and small tools

Postgres partial indexes are criminally underrated

Most tables have a soft-delete flag or a status column, and most queries filter on it. A partial index over the rows you actually select is smaller, hotter in cache, and cheaper to maintain than an index over everything. We shaved a p95 report query from 900 ms to 40 ms by indexing WHERE deleted_at IS NULL and nothing else.

A Makefile is still a perfectly good task runner

Every team I join debates replacing make with something fancier, and three years later the Makefile is still there. Keep targets tiny, echo what they do, and let newcomers run make help. The boring tool that everyone already understands wins.

Reading flame graphs without fear

py-spy made profiling a service you can do during lunch: record a flame graph of the live process, no restarts, no instrumentation. The trick is to stop reading individual frames and look for wide plateaus instead — that is where the time actually goes.

Why we write one-page decision records

Not because the documents are valuable — because writing forces the argument to exist. Half of our ADRs end with “revisited, decided against”, and that is the good outcome: a page of writing is cheaper than a week of the wrong architecture.