title: NOT IN vs NOT EXISTS
body: <p>Which of these queries is the faster?</p>
  
  <p>NOT EXISTS:</p>
  
  <pre><code>SELECT ProductID, ProductName 
  FROM Northwind..Products p
  WHERE NOT EXISTS (
      SELECT 1 
      FROM Northwind..[Order Details] od 
      WHERE p.ProductId = od.ProductId)
  </code></pre>
  
  <p>Or NOT IN:</p>
  
  <pre><code>SELECT ProductID, ProductName 
  FROM Northwind..Products p
  WHERE p.ProductID NOT IN (
      SELECT ProductID 
      FROM Northwind..[Order Details])
  </code></pre>
  
  <p>The query execution plan says they both do the same thing.  If that is the case, which is the recommended form?</p>
  
  <p>This is based on the NorthWind database.</p>
  
  <p>[Edit]</p>
  
  <p>Just found this helpful article: 
  <a href="http://weblogs.sqlteam.com/mladenp/archive/2007/05/18/60210.aspx" rel="noreferrer">http://weblogs.sqlteam.com/mladenp/archive/2007/05/18/60210.aspx</a></p>
  
  <p>I think I'll stick with NOT EXISTS.</p>