Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View problem - why it's shown as partial optimization?
Message
 
 
À
25/10/2001 16:45:07
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00573380
Message ID:
00573403
Vues:
20
>>>>Hi everybody,
>>>>
>>>>I've created a local view in View Designer and modified it in EView. I modified SQL to be
>>>>
>>>>SELECT rcode, town, record_fm,  record_to, landct_fm, landct_to,  ;
>>>>calmnth, mdflag, nodata,  notes, ddflag, dsid, state,  extryear, extrweek, ;
>>>>ccode FROM support!filingdate ;
>>>>WHERE BETWEEN(dsID , ?lnIdLow, ?lnIDHigh)  ;
>>>> AND between(state+extryear+extrweek, ?lcStWkLow,  ?lcStWkHIgh) ;
>>>>ORDER BY extryear DESC, extrweek DESC,  rcode, town
>>>>
>>>>On the SQL showplan I see
>>>>Using index tag Deleted to rushmore optimize table filingdate
>>>>Rushmore optimization level for table filingdate: partial
>>>>
>>>>I have both indexes on DsID and StateWeek in FilingDate table. Do you know, what's the problem?
>>>>
>>>>Thanks in advance.
>>>
>>>Index stateweek is state+extryear+extrweek ?
>>>
>>>- Keith
>>
>>Yes. BTW, it doesn't show usage of the other index DsID too. May be this Show Plan just doesn't always work correctly...
>
>Ahah! VFP is tricky here and I wouldn't believe it if I didn't see it with my own eyes:
>
>"You can use BETWEEN() or INLIST() in the following two forms:
>
>eIndex BETWEEN(eIndex, eExpr, eExpr)"
>
>Looks like you have to change your WHERE to:
>
>dsID BETWEEN(dsID , ?lnIdLow, ?lnIDHigh)  ;
>AND state+extryear+extrweek between(state+extryear+extrweek, ?lcStWkLow,  ?lcStWkHIgh)
>
>
>Crazy, huh?

Keith,

Originally I had this SQL with BETWEEN as a command. I changed it myself to use BETWEEN as function (view designer creates COMMAND like SQL, I prefer to use FUNCTION type). In both cases, it doesn't make a difference. I guess, I just would not trust this show plan info. Obviously all three indexes DELETED(), StateWeek, DsID must be used. I don't see a reason, why they don't.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform