Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK or LOCATE?
Message
From
14/08/1999 11:13:01
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
13/08/1999 13:36:21
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00253099
Message ID:
00253757
Views:
38
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
Map
View

Click here to load this message in the networking platform