Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore
Message
De
26/04/2005 06:19:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01008357
Message ID:
01008373
Vues:
19
>Thank you Fabio,
>Is there a way to make this query optimizable?

On your context, it is full optimized, with the VFP engine capability.
Of course, if you known that
(SELECT Egn FROM Sl_Bel WHERE Sl_Bel.God == 2005)
return a big list, then you have to change the plan.

way 1 ( "NOT IN" is invariant with "LEFT JOIN + WHERE joinkey IS NULL" )
* try, but i'm not sure that force is used, AND THEN IT CAN TO BE SLOWER
SELECT Rab.Egn,;
       Rab.Ime AS Ime,;
       2005        AS God;
       FROM FORCE Sl_Bel ;
         RIGHT JOIN Rab ON Sl_Bel.God == 2005 AND Sl_Bel.Egn=Rab.Egn;
       WHERE Sl_Bel.Egn IN NULL;
INTO CURSOR GodBel READWRITE NOFILTER
WAY 2 ( vfp9 )
SELECT Rab.Egn,;
       Rab.Ime AS Ime,;
       2005        AS God;
       FROM FORCE (SELECT DISTINCT Egn FROM Sl_Bel WHERE Sl_Bel.God == 2005) Sl_Bel1 ;
        RIGHT JOIN Rab ON Sl_Bel1.Egn=Rab.Egn;
        WHERE Sl_Bel1.Egn IN NULL;
INTO CURSOR GodBel READWRITE NOFILTER
however, the result depends on the COUNT(Sl_Bel1)/COUNT(rab) value,
and the query with IN (SELECT...) could be faster.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform