3 ms·
At work, we’ve been struggling with some really slow Postgres queries in our SaaS platform - especially around reporting endpoints that hit orders, products, an
by miguelpaoc 1y ago
At work, we’ve been struggling with some really slow Postgres queries in our SaaS platform - especially around reporting endpoints that hit orders, products, and user data. I spent a few weeks digging deep into performance (EXPLAIN ANALYZE + buffers became my best friend), and ended up applying 5 specific tricks that gave us up to a 10× speed-up.
I put together a write-up with the ones that helped most: lateral joins with json_agg, partial indexes, filter aggregates, etc. It’s focused on practical changes that have actually had an impact.
Curious how others have tackled Postgres performance at scale — I’d love to hear what’s worked for you, or anything you’d have done differently.