InterviewBuddy
All interview questions

What is an N+1 query problem?

Intermediate

Answer

It occurs when loading N records triggers another query per record. Fetch related data in batches or use an appropriate join to reduce repeated round trips.