Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INNER JOIN or Sub-query?
Message
 
 
À
20/03/2006 11:05:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01105835
Message ID:
01105873
Vues:
21
>>I haven't count it, but depending on which form calls it it should be either ~ 80 (for all departments) or ~ 20 (for particular department) or 1 (for a given user).
>>
>
>below 100 items you can use ASCAN() or IN() without penalty on performance.
>
Right, but which one is better? In order to use ASCAN or IN I have to create a IN string first, right? Or you're suggesting IN (select cUserID from ...)? Or both will give the same performance (JOIN vs IN (SELECT ...)) ?

>>iUsedID is a field in UsGrLink table, which corresponds to iID in Users table. I'm using cUserID for all other queries, since it's much more readable.. Users table has an index on both iID and cUserID.
>
>sorry, but i disagree fully here :)
>when you duplicate a field and an index, you are out of normalize table
>and increase very the possibility of errors due to not aligned data
>
>If you uses iUserId you can filter UsGrLink.iUsedID directly.

True, but unfortunately I could not. Besides, I may need cUserID as one of the return field.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform