Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views
Message
De
31/01/2001 00:47:18
 
 
À
30/01/2001 23:12:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Views
Divers
Thread ID:
00470514
Message ID:
00470528
Vues:
39
>I have a view
>
>SELECT SUM(IIF(.NOT.EMPTY(Subscriber.c_premiumproduct_id),1,0)) AS getpremiumproduct,;
> SUM(IIF(EMPTY(Subscriber.c_premiumproduct_id),1,0)) AS dontgetpremiumproduct;
> FROM subscription!subscriber FULL JOIN subscription!gifts ;
> ON Subscriber.c_id = Gifts.c_id;
> WHERE Subscriber.c_id <> Gifts.c_id;
> AND (Subscriber.i_last_issue_sent=0 = .T.;
> AND Subscriber.l_paid = .T.;
> AND Subscriber.i_renewals = 0;
> AND Subscriber.l_online_subscriber = .F.;
> AND Subscriber.c_region = ?c_region_id;
> AND Subscriber.l_start_with_next_issue = .F.;
> AND Subscriber.l_cancel = .F.)
>
>In this particular case I have two tables a subscriber table and a giver table. I only want to select those records which don't have a matching record in the giver table; therefore where subscriber.c_id <> gifts.c_id. Is this the best way to handle this. Also I am trying to optimize the select in which I have created an index for each of where clause with the exception of the subscriber.c_id <> gifts.c_id. However each of the tables do have a index on the c_id. One thing I haven't done however is to create an index on deleted(). I am just wondering if I have provided enough for this to be optimized and execute as fast as possible.

You can use SYS(3054, 11) to check if the view is optimized.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform