Since various elements of the Inspector backend rely on Laravel, I worked a lot with the ORM component myself, and its Eager Loading features. Laravel Eloquent (the Laravel’s ORM) has meant for me a huge increase in productivity and flexibility in building Inspector.
As our application grows or is subject to ever higher load, we need to improve the use we make of our technology stack.
In this article I’ll show you how I saved 1.2 million queries per day using Eager Loading correctly.
However, with eager loading, we only need to run two queries to retrieve the 10 posts and their comments.