N+1 Query

Turkish equivalent: N+1 sorgu problemiDomain: Software Engineering

A data-access performance problem in which one initial query is followed by one additional query for each returned item or relationship.

Software Engineering Context

An N+1 query pattern performs one query to obtain a collection and then additional queries for individual elements or associations. Lazy ORM associations are a common trigger, and a pattern that is invisible with small test data can become a major latency, connection-pool, and database-CPU cost at production cardinality.

Design Boundary

N+1 is not exclusively an ORM problem. A loop that performs one remote service or database request per item has the same multiplicative access pattern.