title: MySQL stored procedure vs. multiple selects
body: <p>Here's my scenario:</p>
  
  <p>I've got a table of (let's call them) nodes.  Primary key on each one is simply "node_id".</p>
  
  <p>I've got a table maintaining a hierarchy of nodes, with only two columns: parent_node_id and child_node_id.</p>
  
  <p>The hierarchy is maintained in a separate table because nodes can have an N:N relationship.  That is to say, one node can have multiple children, and multiple parents.</p>
  
  <p>If I start with a node and want to get all of its ancestors (i.e. everything higher up the hierarchy), I could either do several selects, or do it all in one stored procedure.</p>
  
  <p>Anyone with any practical experience with this question know which one is likely to have the best performance?  I've read things online that recommend both ways.</p>