Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scatter with memo
Message
De
03/06/2003 12:21:04
 
 
À
03/06/2003 11:52:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00795601
Message ID:
00795751
Vues:
17
>>
>No chance for me to know how VFP team designed that but I trust them :)
>Below is a very simple test (very simple in that it can't be a reason to solidly say append from is better) :
>

Ahhh....I see what you're saying. I had a different scenario in mind.

My point is that if this function is going to be called multiple times in a row, APPEND FROM is not effective. For example, assume there is a list of items that need to be archived.

It is not clear this thread whether Steve will call his routine multiple times in a row.
create cursor recordsToProcess (myPK i)
rand(-1)
for i = 1 to 10
    * hope we don't get lucky and create a duplicate :)
	insert into recordsToProcess values (rand()*500000)
next i	

Create Cursor myTest1 (myPk i, myVal c(10))
For ix=1 to 1000000
 Insert into mytest1 values (ix, Sys(2015))
endfor
Index On myPK tag myPK

AFields(arrNew)
Create Cursor myTest2 from array arrNew
Create Cursor myTest3 from array arrNew


lnStart = Seconds()
Select recordsToProcess
scan
	select myTest1
	scan for myTest1.mypk = recordsToProcess.mypk
		 Scatter memvar
		 Insert into myTest2 from memvar
	endscan

endscan
? Seconds()-lnStart


lnStart = Seconds()
Select recordsToProcess
scan
	select myTest3
	Append From Dbf('myTest1') for myPK = recordsToProcess.myPk
endscan
? Seconds()-lnStart
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform