title: Mysql inner join vs in clause performance
body: <p>I have a query to get data of friends of user. I have 3 tables, one is user table, second is a user_friend table which has user_id and friend_id (both are foreign key to user table) and 3rd table is feed table which has user_id and feed content. Feed can be shown to friends. I can query in two ways either by join or by using <code>IN</code> clause (I can get all the friends' ids by graph database which I am using for networking).</p>
  
  <p>Here are two queries:</p>
  
  <pre><code>SELECT
    a.*
  FROM feed a
  INNER JOIN user_friend b ON a.user_id = b.friend_id
  WHERE b.user_id = 1;
  </code></pre>
  
  <p>In this query I get friend ids from graph database and will pass to this query:</p>
  
  <pre><code>SELECT
   a.*
  FROM feed a
  WHERE a.user_id IN (2,3,4,5)
  </code></pre>
  
  <p>Which query runs faster and good for performance when I have millions of records?</p>