Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to find a record
Message
From
11/06/2005 07:40:24
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018119
Message ID:
01022431
Views:
17
Hi Sergey,
>The index "design" is bad. Try
SET EXACT OFF
SEEK transform(13609,'99999999')
SCAN WHILE transform(de_sysnum,'99999999')+transform(de_histnum,'9999') = transform(13609,'99999999');
       FOR de_sysnum == 13609
   **** Do something
ENDSCAN
...
>>active index is:
>>transform(de_sysnum,'99999999')+transform(de_histnum,'9999')

I'ld have proposed
SET EXACT OFF
SEEK transform(13609,'99999999')
SET EXACT ON
SCAN rest WHILE de_sysnum = 13609
      **** Do something
ENDSCAN
Since the controlling index already forces the order. Am I overlooking something ?
The dsik movement optimization which is the main optimization should still be identical,
but why the 2 checks ? And "==" used with numerical fields was definitly slower
in tests done a long time ago - haven't checked recently.

regards

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform