Articles
Notes on backend architecture, performance work, and the WordPress and Laravel systems I build.
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
15 min readMillions of rows nobody uses: how to delete them without breaking production
You found a table with millions of rows and no obvious owner. This is the playbook: prove nothing reads it, make every step reversible before any step is destructive, then delete in batches your replicas can survive — with the MySQL and PostgreSQL queries that produce the evidence.
Intermediate- Databases
- MySQL
- PostgreSQL
- Operations