Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Improving sluggish SQL
Message
 
À
21/12/1999 09:46:56
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00306158
Message ID:
00306733
Vues:
34
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform