N+1 queries after eager-load removal

On-call incidentMedium30 minShopify style

Your task

v62 of the dashboard service (Ruby on Rails) rolls out at 11:30. Page loads on the project-list view get slow (p95 from 300ms to 4s) and the primary database's query rate jumps 8x while its CPU climbs to 95%, even though user traffic is unchanged. Slow-query logs show a flood of tiny identical-shaped SELECTs against the 'members' table, one per project row. v62 'cleaned up' the project-list query by removing an explicit eager-load. Triage and mitigate.

It covers

  • N+1
  • Database load
  • Orm