title: How to use JOIN instead of sub query (NOT IN)
body: <p>I want to list all people that <code>$_SESSION['userid']</code> follows and not follows</p>
  
  <p>This query below is for follows cast, it works</p>
  
  <p><strong>IN</strong> (slow)</p>
  
  <pre><code>SELECT user.* FROM user 
  WHERE user.userid 
       IN (SELECT follow.followtoid FROM follow 
  WHERE follow.followerid = $_SESSION['userid'])
  </code></pre>
  
  <p><strong>JOIN</strong> (fast)</p>
  
  <pre><code>SELECT p.* 
  FROM user p
      JOIN follow f ON p.userid = f.followtoid
  WHERE f.followerid = $_SESSION['userid']
  </code></pre>
  
  <p>For those still not follow cast, it works but seems very slow<br />
  Please suggest me how do i use JOIN instead of NOT IN</p>
  
  <p><strong>NOT IN</strong> (slow)</p>
  
  <pre><code>SELECT user.* FROM user 
  WHERE user.userid 
       NOT IN (SELECT follow.followtoid FROM follow 
  WHERE follow.followerid = $_SESSION['userid'])
  </code></pre>