Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the main difference?
Message
De
31/01/1997 08:56:48
 
 
À
30/01/1997 13:36:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00018843
Message ID:
00018936
Vues:
36
>>>What's the main difference of those 2 SQLs? Am I right to say that the first one is faster than the second one?
>>>
>>>SELECT ELEM_ID FROM ELEM WHERE EXISTS (SELECT ELEM_ID FROM ANSWER WHERE RATER_ID=254 AND ANSWER.ELEM_ID=ELEM.ELEM_ID)
>>>
>>>SELECT ELEM.ELEM_ID FROM ELEM,ANSWER WHERE ANSWER.RATER_ID=254 AND ANSWER.ELEM_ID=ELEM.ELEM_ID AND ELEM.CHILDREN
>>
>>where is the elem.children in the first sql?
>
>Your correct is should have been
>
>SELECT ELEM_ID FROM ELEM WHERE CHILDREN AND EXISTS (SELECT ELEM_ID FROM ANSWER WHERE RATER_ID=254 AND ANSWER.ELEM_ID=ELEM.ELEM_ID)
>
>>in theory (according to the books) the first one should be faster...
>
>So, if the tables grow, the first one will always return the SQL immediately because it benefits of full Rushmore and the second one not?

Have you tried to INNER JOINing the two tables, I find it faster that joining in the WHERE clause.
Alexandre Nobre
Alpha Bytes Computer Corp.

Did you know that there are innocent people dying in East Timor?
It helps if you do...

I suppose you don't need glasses if you're able to read this line

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform