Backend & systems·Data modelling and storage engines
you fetch a list of fifty orders and then the ORM quietly issues fifty more queries, one per order, to load the customer.
N+1 query
Also calledselect N+1
A pattern where fetching a collection triggers one additional query per element, usually via lazy-loaded ORM associations. Latency scales with result size instead of staying flat, so the endpoint is fine in development with three rows and terrible in production with three hundred. The fix is an eager load, a join, or a batched second query.