title: SQL query 'not in' clause execution takes too long
body: <p>the following query takes too much time, most likely because of a 'not in' use.</p>
  
  <p>Can you suggest any improvement ?</p>
  
  <pre><code>SELECT vcode, 
         vname, 
         1014 AS fid 
  FROM   testcodes co 
  WHERE  co.vcode NOT IN (SELECT dict.vcode 
                          FROM   datadictionary dict 
                          WHERE  dict.fid = 1014) 
  </code></pre>
  
  <p>one thing about structure is .
  vCode,vName is varchar
  and testCodes and DataDictionary have same structure.</p>
  
  <p>I searched this problem and found that the left join can possibly resolve this? (WHY does it do better and how can it be done)?</p>
  
  <p>can someone guide if it can be improved ???</p>