Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set filter slow my operation
Message
From
26/07/2004 12:07:12
 
 
To
26/07/2004 10:21:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00927837
Message ID:
00927953
Views:
20

If your filter is:

SET FILTER TO char3=thisform.combo1.value

Then I assume that char3 is a field in the table.

In this case, you should have an index with the expression char3. This will make both a filter and a query faster, if they use this field for a condition.

For more details, search the help file for "Rushmore Optimization".


Hilmar, vfp it is not designed very well,
and SET FILTER is optimizable ONLY IF NONE INDEX IS ACTIVE
CREATE CURSOR BLA (char3 c(3))
FOR k=1 TO 1000000
	APPEND BLANK
NEXT
INSERT INTO BLA VALUES('12')
INSERT INTO BLA VALUES('11')

INDEX ON char3 TAG IX_char3

? "Expected similar times"

SET EXACT OFF
SET FILTER TO char3='1'
CLEAR
T1=SECONDS()
SCAN
ENDSCAN
?  char3,SECONDS()-T1,ORDER(),KEY()
SET ORDER TO
T1=SECONDS()
SCAN
ENDSCAN
?  char3,SECONDS()-T1,ORDER(),KEY()
Previous
Reply
Map
View

Click here to load this message in the networking platform