Обложка канала

Amazing PHP

8898 @phpme

Welcome to the Amazing PHP Channel!Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Amazing PHP

8 лет назад
Открыть в
Dynamic relationships in Laravel using subqueries
Developers are typically pretty good at the first goal. We're aware of N+1 style problems, and use techniques like eager-loading to limit database queries. However, we're not always the best at the second goal—keeping memory usage down. In fact, we sometimes do more harm than good trying to reduce database queries at the expense of memory usage.

Let me explain how this happens, and what you can do to satisfy both goals in your app.