Skip to main content
Alvin QuachFull Stack Developer
HomeProjectsExperienceBlog
HomeProjectsExperienceBlog
alvinquach

Full Stack Developer building systems that respect complexity.

Open to opportunities

AQ

Projects

  • All Projects
  • Hoparc Physical Therapy
  • OpportunIQ
  • Hoop Almanac
  • SculptQL

Knowledge

  • Blog
  • Experience
  • Interview Prep

Connect

  • Contact
  • LinkedIn
  • GitHub
  • X

Resources

  • Resume
© 2026All rights reserved.
Back to Blogs
Bug Fix
Depth: ●●○○○

Debugging N+1 Queries in Player Stats

How I identified and fixed database performance issues that were causing 4+ second load times.

Published January 8, 20261 min readImportance: ★★★★☆
Share:

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.

Finding the Problem

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.

Bar Chart