Databases · Middle · Question 35 of 75

What is the N+1 query problem?

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).

Further reading

Problem with a question

Databases · Middle · question 35

Test yourself

Take the Databases · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz