title: mysql efficient select query for each user (use join or not)
body: <p>I have the following job select query (the actual query is massive with many joins)
  Main query: </p>
  
  <pre><code>SELECT id FROM job LIMIT 20
  </code></pre>
  
  <p>When the user log in, I want to select if the user has saved the job. (many users but one main result)</p>
  
  <p>My question is more efficient method? (thinking in terms of query cache, buffer pool etc)<br>
  method 1:</p>
  
  <pre><code>SELECT id, Member 
  FROM job AS t1 LEFT JOIN Member AS t2 ON (t1.id=t2.Job) LIMIT 20
  </code></pre>
  
  <p>(i.e. if user didn't saved the job it would return 'Null' for Select Member)</p>
  
  <p>method 2:<br>
  use the Main query for the main result, then for each result select (i.e. loop sql query) </p>
  
  <pre><code> SELECT Member FROM Member WHERE Member=1 AND Job=(each job id)
  </code></pre>