Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does left right position matter on joined table/views
Message
De
13/02/2009 15:11:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Does left right position matter on joined table/views
Divers
Thread ID:
01381641
Message ID:
01381641
Vues:
89
Hello everyone,

I am working to make my data access faster. I have combinations of table joins and views joined to other tables. I have added compound indexes for all my joins and where conditions.

(1) My question is does the left or right table position in a join condition matter?

For example:

(A) Select * from table1 inner join table 2 on table1.field1 == table2.field1
Verses:
(B) Select * from table1 inner join table 2 on table2.field1 == table1.field1

Are (A) and (B) equivalent? Does it matter that table1 was listed first so table1 in the join should be listed first?

Sometimes I have a view in place of table1 (which have no indexes), but table2 still does.

(2) I know FoxPro always looks at the left side of an equal sign for any existing indexes for where conditions, but is that the same for join conditions where the left side (view side) has no indexes or will it see and actually use the indexes on the right side (table2)?

For example:

(C) Select * from View1 inner join table 2 on View1.field1 == table2.field1
Verses:
(D) Select * from View1 inner join table 2 on table2.field1 == View1.field1

Will example (D) perform better than (C) based on the left side available indexes still on the table2?

If you know the answer to these issues I would appreciate learning from your experience.

Thanks Gary.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform