The process of hydration becomes extremely expensive when more than 2 LEFT JOIN operations clauses are part of our queries:
{% for category in categories %}
{% for post in category.lastPosts %}
{% for comment in post.lastComments %}
{{ comment.content }}
{% endfor %}
{% endfor %}
{% endfor %}
SELECT *.p FROM 'post'.'p' WHERE 'p'.'category_id' IN (2, 3, 5, 7, 9) ORDER BY id DESC LIMIT 20;
App\:
resource: '../src/*'
exclude: '../src/{Request,Entity,Migrations,Tests,Command,Kernel.php}'
services:
_defaults:
autowire: true
autoconfigure: true
public: false
{% extends 'layout.html.twig' %}