Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL optimization
Message
De
21/08/2001 06:48:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL optimization
Divers
Thread ID:
00546622
Message ID:
00546622
Vues:
42
Hi,
I want to ask something about rushmore in VFP6.0
I tried 2 methods to join 2 tables
1. select A.*,B.* from A inner join B on A.key1=B.key1 and A.key2=B.key2 where A.key1=constantA
2. select A.*,B.* from A inner join B on A.key2=B.key2 where A.key1=ConstantA and B.key1=ConstantA
and found the time taken was different! SQL 2 was much faster than SQL 1.
All fields included in the condition was indexed. I used sys(3054) to check, and found that SQL 2 used temp index and SQL1 used key2 as index. Could anybody tell me why?
TIA.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform