Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help Optimizing a query
Message
De
17/08/2001 12:04:35
 
 
À
11/08/2001 03:37:14
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00542086
Message ID:
00545426
Vues:
16
>Hi Dan,
>
>IMO, the following be about the fastest way to get the data you want.
>
>
SELECT YourTable
>SET ORDER TO TAG Ramp
>SEEK "CHICAGO"
>COPY FIELDS Ramp, Vendor, VendCity, VendSt, HourCount ;
>     TO TempTable ;
>     FOR Between( HourCount, 37, 48 ) And Upper( Vendor ) = 'NIKE' ;
>     WHILE Ramp="CHICAGO"
>
>I think it would be hard to get any faster than this with a SQL statement.
>
>Walter,

I think I've finally found the answer. This Select is actually a drill down from another summary table. I've managed to pre-digest the table so that each drilldown corresponds to a single value which I place in a one character field called RampCode. I've simplified somewhat, but basically, using Walter's COPY idea the final code looks like this.
Select RampDrillDown
Set Order To RampCode
Seek "1"

COPY FIELDS Ramp, Vendor, VendCity, VendSt, HourCount ;
     TO tRampDrillDown ;
     WHILE RampCode="1" NoOptimize
The NoOptimize is the key. Without the NoOptimize, this same COPY takes about 20 to 25 seconds. In this case, for whatever reason, optimization fails.

Thanks, all for struggling with me to find a solution.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform