Databases · Middle · Question 35 of 75
What is the N+1 query problem?
- 1Running N queries in parallel on N+1 servers
- 2A query that returns one extra row
- ✓Correct answer: Loading a list with one query and then running one more query per item to load related data
Explanation
Fix it with a join, WHERE id = ANY($1) or IN (...) for all IDs at once, or the ORM's eager loading (include, with).