Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INDEXSEEK()
Message
From
13/11/2001 19:40:41
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00580322
Message ID:
00581249
Views:
18
Mike, heres the code with a GO 1 instead of GO BOTTOM. Since my data set has only 10 records then there are no optimisation issues really. You can take the GO 1 line out and the results are almost the same (0.91, 1.00, 0.57 and 1.15 secs resp.). INDEXSEEK is *slower* than SEEK except where there is no filter and set deleted is OFF
local i, t
* Assume RMast is open
* assert record 1 is not deleted and is Active
set filter to

* NOTE: Rnum=2 is a deleted record and Active=.F.!

t= seconds()
set deleted on
for i = 1 to 100000
	 =seek(2, 'Rmast', 'RNum')
	 go 1
endfor
? 'Old SEEK took ' + str(seconds()-t, 12,2)
* 0.91 secs

t= seconds()
set deleted on
for i = 1 to 100000
	 indexseek(2, .F., 'Rmast', 'RNum')
	 go 1
endfor
? 'Indexseek DELETED ON took ' + str(seconds()-t, 12,2)
* 1.00 secs

t= seconds()
set deleted off
for i = 1 to 100000
	 indexseek(2, .F., 'Rmast', 'RNum')
	 go 1
endfor
? 'Indexseek DELETED OFF took ' + str(seconds()-t, 12,2)
* 0.58 secs

set filter to Active
t= seconds()
set deleted off
for i = 1 to 100000
	 indexseek(2, .F., 'Rmast', 'RNum')
	 go 1
endfor
? 'Indexseek DELETED OFF, FILTER ON took ' + str(seconds()-t, 12,2)
* 1.28 secs
Previous
Reply
Map
View

Click here to load this message in the networking platform