When Postgres is the wrong place to traverse the graph
Recursive CTEs hit an O(b^D) wall, and no amount of indexing or tuning moves it.
Andrey Minogin is a software architect with 15+ years on data-intensive systems. He finds out why a system in production is slow, expensive or wrong — in Java and Kotlin services, in PostgreSQL, and in LLM workflows — and what to change. He writes about engineering at minogin.com.
48 views
Recursive CTEs hit an O(b^D) wall, and no amount of indexing or tuning moves it.
Compression put 31× fewer bytes on the wire and made the request 27 seconds slower.
An in-memory graph is fast until you need to write to it.
When twenty operations run billions of times and none of them is hot, a flame graph tells you about HashMap and nothing you can act on.

A check took 29 s. Removing it saved 24 s - the rest moved to a line we didn't touch. Why?