Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report runs much slower in VFP 9 than VFP 7
Message
De
23/02/2005 17:13:52
 
 
À
23/02/2005 16:26:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00989847
Message ID:
00989870
Vues:
18
SET TALK ON will display a progress bar.

Make sure there is an index on pireq.csitecode

The &lcfor will never be optimized.

I have seen instances where the SQL statement ran much faster doing joins with the JOIN statement rather than in the WHERE statement.

Also, it is dangerous to do an ALLTRIM in the field list. The field will only be as wide as LEN(ALLTRIM()) the first record and you can never be sure which record will be the first. Fox uses fixed length fields. Either just use the field or use LEFT(field, 15) or some other length.

>I have am porting an application from VFP 7 to VFP 9. I have at least one report that runs much more slowly in VFP 9 than it did in VFP 7. I did have to add a new field and related selection criteria. Report is run from a form which gets the dates and start up program sets the global variable. VFP 7 code
>
>	SELECT DISTINCT ;
>		piitems.clstkno , ;
>		pireq.creqno , pireq.cacccode, pireq.dreqdate, ;
>	        piitems.cuomissu , piitems.nreqqty , ;
>		instock.cdescript , ;
>		ALLTRIM(accounts.camfname) AS 'camfname' , ;
>		ALLTRIM(accounts.camlname) AS 'camlname' ;
>	FROM pireq , piitems , instock , accounts ;
>	ORDER BY piitems.clstkno, pireq.creqno , pireq.dreqdate ;
>	WHERE pireq.creqno = piitems.creqno ;
>		AND BETWEEN(pireq.dreqdate , m.dstartdate , m.denddate ) ;
>		AND ALLTRIM(piitems.clstkno) = ALLTRIM(instock.cstkno) ;
>		AND piitems.csitecode = gcsitecode ;
>		AND pireq.cacccode = accounts.cacccode ;
>		&lcfor ;
>	INTO CURSOR stokisue
>
>VFP 9 code
>
>	SELECT DISTINCT ;
>		piitems.clstkno , ;
>		pireq.creqno , pireq.cacccode, pireq.dreqdate, ;
>		piitems.cuomissu , piitems.nreqqty , ;
>		instock.cdescript , ;
>		ALLTRIM(accounts.camfname) AS 'camfname' , ;
>		ALLTRIM(accounts.camlname) AS 'camlname' ;
>	FROM pireq , piitems , instock , accounts ;
>	ORDER BY piitems.clstkno, pireq.creqno , pireq.dreqdate ;
>	WHERE pireq.creqno = piitems.creqno ;
>	        AND BETWEEN(pireq.dreqdate , m.dstartdate , m.denddate ) ;
>		AND ALLTRIM(piitems.clstkno) = ALLTRIM(instock.cstkno) ;
>		AND pireq.csitecode   = gcsitecode ;
>		AND piitems.csitecode = gcsitecode ;
>		AND pireq.cacccode = accounts.cacccode ;
>		&lcfor ;
>	INTO CURSOR stokisue
>
>Note addition selection criteria for additional field in pireq table AND pireq.csitecode = gcsitecode ;. In this case &lcfor is a blank.
>
>I would like to either speed up SELECT if possible, or put in a progress bar if possible (P.S. FWIW I am using SDT).
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform