Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use select... where EXISTS ... ?
Message
 
 
À
27/05/2003 12:10:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00793069
Message ID:
00793156
Vues:
35
>Sergey,
>Didn't do the tests. You might be right. Just thinking on SQL specification most of the time EXISTS sounds to be faster to me. Both subqueries might be called N times, however say subquery for IN is returning 1000 rows and the value compared is about the ends. Each time nearly 1000 rows should be checked. OTOH for EXISTS it's either a .T./.F. return. Subquery might still return 1000 rows but 1 or 1000 means .T. and returns immediately.
>Just my 0.02 cents.

Hi Cetin,

In reality, IN subquery runs only once and VFP can build index on it and use equivalent of SEEK() function to find if record is in that result set. The EXISTS subquery has to be run agains the real table for each record in the main query.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform