title: Mysql not exists or an alternative
body: <p>An example of a table, data along with the query can be found in <a href="http://sqlfiddle.com/#!9/2e65dd/3" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/2e65dd/3</a></p>
  
  <p>I'm interested in finding all distinct user_id's that don't have certain record_type.</p>
  
  <p>In my actual case, this table is huge and it has several million records in it and have an index on user_id column. Although i'm planning to retrieve it in batches by limiting the output to 1000 at a time.</p>
  
  <pre><code>select distinct user_id from 
  records o where 
  not exists (
      select * 
      from records i 
      where i.user_id=o.user_id and i.record_type=3) 
  limit 0, 1000
  </code></pre>
  
  <p>Is there a better approach to achieve this need ?</p>