Q&A
Q&AHow do you confirm and fix an ORM N+1 query?
Count repeated statements per request, then batch-load without changing result cardinality.
Read the concise answer
Trace or log normalized SQL for one request and look for the same child lookup repeated once per parent row. Replace the loop with an eager/batch load or a query at the correct grain. Verify query count and returned rows; a broad join can fix round trips while accidentally multiplying results.