Information générale
Catégorie:
Codage, syntaxe et commandes
If the environment is the same between the two queries my guess is that the first one is joining table_C with the result of the first join (which is a smaller set than all of table_A). Similar differences in execution time occur with complex subselects where breaking the subquery out as it's own query will reduce execution time by orders of magnitude.
>Thanks Chaim, I'll see if I can find the articles at the FoxPro Advisor site.
>One of the queries I have is illustrated by this example:
>
>FROM table_A JOIN table_B ON table_A.x = table_B.x ;
> JOIN table_C ON table_A.x = table_C.x ;
>Is table_C being joined on table_A or on the result set of the first join?
>
>Also, the above syntax seems to process much faster than the following equivalent which was produced by the Query designer :
>FROM table_A JOIN table_B JOIN table_C ;
> ON table_A.x = table_B.x ;
> ON table_A.x = table_C.x ;
>
>Is there a trap in the first method that I haven't fallen into yet...?
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement