Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL CODE - SELECT Statement
Message
De
26/08/2003 10:44:36
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00823214
Message ID:
00823430
Vues:
22
>Hi Jim,
>
>
>PMFJI,
>
>
>>1) Why would the subquery in the above only have to run once if NOT IN... was used, considering that the subquery's WHERE argument is changed from record to record?

>
>Tamar referes to the original query which has to be run only once and result is cached by VFP.
	WHERE tmpPDFFileNames.cFileName NOT IN (SELECT cFileName FROM SCAN)	;
>
>>2) How can NOT IN be faster that NOT EXIST... when the former needs to get ALL possibly qualifying records and then compare them while the latter only has to get a single record to 'know' that the "NOT" is not satisfied?
>
>In most cases it is faster because VFP caches the result of the NOT IN subquery and don't need original data for NOT IN check. In case of correlated NOT EXISTS subquery, it has to be run for every row in the main query against original data in the table.

I should have gone back and looked at the original query. My bad.

cheers and thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform