Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to speed this loop and/or SQL up?
Message
De
21/03/2005 09:37:52
 
 
À
21/03/2005 09:10:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00997258
Message ID:
00997806
Vues:
13
My point is that the where clause must match the index epression EXACTLY. Try to divide the select into two selects, and make the first select statement select as few records as possible, something like this:
lnSEQNO=SEQNO && You must change this!!
Select * from RZStop where;
 RTE_NO + RTE_LET + DIRECTN + STR(SEQNO,4) + STR(NUMBER,3)=lcRteNo + "A" + lcDirectn + STR(lnSEQNO,4) + STR(lnNumber,3) into cursor dummy nofilter
Select DISTINCT TIME from dummy ;
 where ALLTRIM( RZStop.RTE_NO)  == lcRteNo ;
 and RZStop.RTE_LET	       == "A" ;
 and RZStop.DIRECTN	       == lcDirectn ;
 and	 ALLTRIM( RZStop.Stop)   == lcStopNo ;
 and	 ALLTRIM( RZStop.County) == lcCounty ;
 and	 RZStop.Number	       == lnNumber ; 
 and not EMPTY( RZStop.TIME) ;
 to SCREEN NOCONSOLE
>Tore
>
>>What is the index expression for your table?
>
>Not sure what you mean by that but the order is:
>
>Set Order To RGDSNum && RTE_NO + RTE_LET + DIRECTN + STR(SEQNO,4) + STR(NUMBER,3)
>
>Terry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform