Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does left right position matter on joined table/views
Message
 
 
To
13/02/2009 15:11:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01381641
Message ID:
01381645
Views:
47
Thre's no difference between A & B, C & D. IOW, the order of tables in a JOIN conditions doesn't matter.
However,
...
table1.field1 == table2.field1
* may be slower than
SET ANSI ON
...
table1.field1 = table2.field1
>
>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.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform