Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Improving sluggish SQL
Message
 
To
21/12/1999 09:46:56
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00306158
Message ID:
00306733
Views:
35
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform