Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Silly little grid question
Message
From
22/01/2005 13:48:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00979303
Message ID:
00979640
Views:
10
>>>Try to issue LOCATE after setting filter
SET FILTER TO ...
>>>LOCATE
>>
>>Is this supposed to be faster than GO TOP?
>
>It's a habbit from fox 2.6 days when LOCATE with FILTER was rushmore optimizable and GO TOP wasn't. I don't know if it still hold true for the latest VFP versions.

Yes.

Current situation:
* exists a index for the filter condition
GO TOP and LOCATE (FOR .T.) uses a ordered by TAGNO() scan
* exists a index TAGUSEDFOROPTIMIZATION for the filter condition
1 TAGNO()=0 ( TABLE order)
GO TOP use a ordered by TAGNO() scan
FOR condition uses a full optimized SEEK ( time is o(Log(RECCOUNT))
2 TAGNO()#TAGUSEDFOROPTIMIZATION
GO TOP use a ordered by TAGNO() scan
FOR condition uses a partial optimization ( time is o(RECCOUNT))
3 TAGNO()=TAGUSEDFOROPTIMIZATION
This is a important issue because
VFP don't see this as full optimizable !!!
GO TOP use a ordered by TAGNO() scan
FOR condition uses a partial optimization when it can uses a full optimization. Sin.
The workaroud is SET KEY.

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform