Mike Yearwood
Toronto, Ontario, Canada
Walter Meester
HoogkarspelNetherlands
Hi Walter.
Here's the code...
use junk excl
set order to tag patientid
a=seconds()
for i = 1 to 10000
=seek(2017679)
endfor
?seconds()-a
set order to 0
a=seconds()
for i = 1 to 10000
locate for patientid = 2017679
endfor
?seconds()-a
Processor is Pentium II 350 Mhz
96Mb of RAM and a 1 gig swap file.
SET DELETED OFF
Currently Selected Table:
Select area: 1, Table in Use: D:\SPEED\JUNK.DBF Alias: JUNK
Code page: 1252
Structural CDX file: D:\SPEED\JUNK.CDX
Index tag: PATIENTID Collate: Machine Key: PATIENTID
Lock(s): Exclusive USE
Collating sequence: Machine
Table junk contains 2,017,679 records. If you run the code the first time, results were .166 for the seek and 57.015 for the locate. 2nd run which should show caching impact, .168 for the seek and 60.415 for the locate. Reversing the code in the program so the locate happens before the seek had little impact.
The difference is what I call the Rushmore Effect. The locate routine is different from the seek routine. I use seek if I want to find one thing in a table and locate if I intend to process a subset of the table (hence the CONTINUE) command.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only