N+1 Profile Page

medium~30 min

A page listing 100 users makes 101 database queries — one to fetch the users, then one more per user to fetch a related field. Explain the root cause and the fix.

Solution

This one has no written solution — the answer is your own story or your own submission.