title: Doctrine nested set vs adjacency list
body: <p>I need to display a tree of categories by levels (all tree elements on each level).</p>
  
  <pre><code>Root
  Cat1 (parent_id) Cat2 (parent_id) ...
  Subcat1 (parent_id) Subcat2 (parent_id) Subcat3 (parent_id) ...
  </code></pre>
  
  <p>I tried to implement it with Nested Set structure, but I ran into a problem: no easy way to get the parent's node id (without a separate query to the database). Should I use Adjacency list instead? </p>
  
  <p>The goal is to make the display as fast as possible, ideally with one query to the database.</p>