title: How would you optimize this query
body: <p>I'm in VFP9 (Yep, I know) the next query works perfectly, but with a DBF (Table) with a size of 20mb (or 9k of rows) create on the cursor a temp file larger than 2gb (and this crashes VFP9 for being 32bits)</p>
  <pre><code>            SELECT DISTINCT t1.*;
              FROM t1,t2;
              WHERE ALLTRIM(t1.name) = ALLTRIM(t2.name);
              AND ALLTRIM(t1.name2) = ALLTRIM(t2.name2);
              AND t1.tyc = t2.tyc;
              AND t1.nc = t2.nc;
              AND t1.forced = 0;
              AND t1.secuence NOT in (Select secuence FROM t2);   
              Into Cursor cursordel
  </code></pre>
  <p>I only put this fragment of code because works, except when I have more than 2k of rows
  I thought that replacing that &quot;not in&quot; with a join would do the trick, but didnt work or at least the ways that I've tried...</p>