Developer kept complaining our RDS instance was too slow. Wanted to upgrade from db.t3.large to db.r5.8xlarge.
Cost increase: $140/month to $3,400/month.
I checked query performance first:
- Query ran 47,000 times per hour
- No indexes on the WHERE clause columns
- Missing composite index cost 890ms per query
Added two indexes. Query time: 890ms -> 12ms.
Saved $39,000 annually because we spent 15 minutes with EXPLAINING.
Most performance problems are code problems disguised as infrastructure problems.