lazy loading

Loading related data from the database only when code first accesses it, instead of together with the object that refers to it.

In more detail

Lazy loading avoids fetching data nobody uses, but accessing a lazy relation after the transaction has ended fails, and touching one per row issues an extra query each time. Fetch what the response actually needs within the use case.

Related terms

Taught in

References