Articles
Notes on backend architecture, performance work, and the WordPress and Laravel systems I build.
14 min readOne product page, 201 queries: fixing N+1 and making it visible in review
The N+1 query problem, answered end to end — why 201 fast queries add up to 9 seconds while the slow log stays empty, the fix ladder from eager loading to batch loaders and counter caches, the traps (cartesian joins, per-parent limits, huge IN lists), and how to turn query count from a runtime accident into something CI fails on.
Intermediate- Databases
- Performance
- Laravel
- ORM
16 min readSELECT COUNT(*) is slow on 30M rows: how to make counting fast at scale
Why COUNT(*) degrades on a 30M-row table under MVCC, and the full ladder of fixes — keyset pagination, planner estimates, capped counts, covering indexes, sharded summary counters, rollup tables and OLAP replicas — with the MySQL and PostgreSQL code for each and a table for picking the right one.
Intermediate- Databases
- Performance
- MySQL
- PostgreSQL