Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INNER JOIN or Sub-query?
Message
 
 
To
20/03/2006 11:05:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01105835
Message ID:
01105873
Views:
20
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform