How I identified and fixed database performance issues that were causing 4+ second load times.
The player stats page was loading in 4.2 seconds. After investigation, I found the culprit: an N+1 query pattern that was making hundreds of individual database calls.
Using Prisma's query logging, I discovered that loading 50 players was triggering 51 queries - one for the list, then one for each player's stats. Classic N+1.