Laravel Eloquent Query Optimization

preview_player
Показать описание
Laravel Eloquent Query Optimization
=============================
We have discussed here `Eager Loading`, `Lazy Loading` and `Lazy Eager Loading`.

Not optimizing the query is known as a “N+1” issue.

ORMs “Eager” load: If you intend to use the associated model data you can trim that 101 query total to 2 queries using eager loading. You just need to tell the model what you need it to load eagerly.

Lazy Eager Loading: You might only need to gather associated models based on a conditional. In this case, you can Lazy Eager Loading.
Рекомендации по теме
Комментарии
Автор

nice concept bro. i learn new and interesting topic "Lazy Eager Loading"

mesbaulislamrony