>USE TABLE1
>USE TABLE2 IN 0
>COPY TO tempfile FOR !INDEXSEEK(Table1ForeignkeyExpr,.F.,"TABLE2",Table2Keyexpr)
That's a good method.
I've spent time testing different ways this morning, clearing the cache as needed to get accurate testing. This pulls 25,000 mismatched records off of tables of about 500,000 records each.
1) The above method is quite fast, average about 190 seconds.
2) SQL/NOT IN is definitely using the index, no matter that it says NOT OPTIMIZED. This is obvious by the fact that running INTO TABLE with a clear cache took nearly 220 seconds average, while running again immediately took only 157 seconds (in one trial). That's a clear indication of index usage, as I suspected...
3) SQL/NOT IN into a Cursor NoFilter averages about 200 seconds, also not a bad method.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.