Skip to content
engineering workbench.by StudyPort Academy
All glossary terms

GLOSSARY · A WORD, UNPACKED

N+1 query problem

a common performance bug where code executes 1 initial query for parent records followed by N secondary queries in a loop for each child.

A little more detail

Often caused by ORM lazy-loading inside template or array loops, the N+1 problem turns what should be a single database round-trip into dozens or hundreds of sequential network calls. It is solved through eager loading using SQL JOINs or batched IN queries.

See it in practice

These lessons pair the idea with examples you can change and run.