1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/you-can-use-constrained-eager-loading-to-increase-performance-of-database-queries-that-use-relations.md
Samuel Štancl 876878c43a 13/2022
2022-04-02 17:18:22 +02:00

681 B
Raw Blame History

title tweet_id thread_slug author_username images created_at slug
You can use constrained eager loading to increase performance of database queries that use relations 1509994025926885381 weekly-thread-2022-13 mattkingshott
https://pbs.twimg.com/media/FOsQc3JXEAgF1P6.jpg
2022-04-01T20:40:04+00:00 you-can-use-constrained-eager-loading-to-increase-performance-of-database-queries-that-use-relations

🔥 #Laravel Tip: Eager loading a models relationships is a great way to improve performance / avoid the N+1 problem. However, you can go further… with constrained eager loading you can tell Laravel to only load the related records you actually need.