Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing the Calculate function - with an index?
Message
From
04/02/2006 08:21:54
 
 
To
03/02/2006 20:50:34
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092819
Message ID:
01093665
Views:
20
>>>>The actual implementation of this example involves a much more complicated scenario, but I think this expresses the heart of my question.
>>>>
>>>>Calculate sum(b) for a > 10 and a < 15 to m_sum_b
>>>>
>>>>Will execution be speeded up if a is indexed?
>>>
>>>As other have said if there is an INDEX ON A your code will optimize. You can also use BETWEEN(). Calculate sum(b) FOR BETWEEN(a,10,15) to m_sum_b
>>
>>Hi Mike,
>>
>>a small correction to your suggestion: Calculate sum(b) FOR BETWEEN(a,10.0001,14.9999) to m_sum_b
>
>Quite right. Thanks!

No problem. I have always wanted a fourth parameter to the Between() function, namely a True/False for whether the given values are inclusive or not.
Previous
Reply
Map
View

Click here to load this message in the networking platform