5-Table ActiveRecord Join: 8s → 200ms With Subquery Rewrite
Rewrote 5-table ActiveRecord join from 8s to 200ms with subqueries. Learn when PostgreSQL query planner fails and how to fix multi-table joins in Rails.
8 min read