Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6.0 Optimize SQL
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00352764
Message ID:
00352859
Vues:
13
Hi Sergey,

>>>>I'd like to speed up my sql select statement and have tried everything I could think of to make it "Rushmore" optimized, to no avail.
>>>>
>>>>Here are two sql's, the first is slow, the second is fast.
>>>>
>>>>
>>>>***5,323 records in 40.03 secs.
>>>>select dam1, yr_bred, name, sex, sire1, booked_to, last_bred, p_b, date_foal, date_died, cause_deat, ;
>>>>price_sold, buy_name, age_rec, life_earn, cl from master where category = "F" and type = "S" or ;
>>>>type = "W" or type = "Y" order by dam1 into table foals nofilter
>>
>> Use optimizable function INLIST instead of or condition, if number of types <=24 (Inlist is limited by 24 codes).
>>Is there an index on TYPE?
>>
>>
>Or better of use native SQL operator IN
>where category = "F" AND type IN ("S", "W", "Y")

I had some negative experience with IN function. I already discussed this problem in some threads about 2 months ago... Try to find them, if you're interested...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform