Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scatter with memo
Message
From
03/06/2003 11:52:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/06/2003 11:24:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00795601
Message ID:
00795723
Views:
21
>>
>>No loop there. One pass.
>
>Okay...I misread the original code...didn't realize he was only processing one header.
>
>>Scan for ... has the same drawback + as it hits a record it should populate the variables first. Append from execution should be faster (especially if no indexes on target).
>>
>
>But SCAN can be Rushmore optimized, or an index order can be set, do a SEEK, and SCAN WHILE. Will APPEND FROM use the index from the source file?
>
>>PS: If VFP8 you might even think of :
>>
>>insert into ... select ... from ...
>>
>
>Yep :)

Steve,
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) :
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 myTest1
Seek 500000
Scan while myPk < 900000
 Scatter memvar
 Insert into myTest2 from memvar
EndScan
? Seconds()-lnStart
 
lnStart = Seconds()
Select myTest3
Append From Dbf('myTest1') for myPK >=500000 and myPK <= 900000
? Seconds()-lnStart
Insert needs more work then append from IMHO (I guess - a little time ago I badly needed to process huge files quickly and directly writing dbf lowlevel was fastest)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform