Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore and composite index tag
Message
From
22/03/2008 12:44:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01304565
Message ID:
01304576
Views:
22
>>
>>In VFP 9 they can be used:
>>
>>CLEAR
>>SET DELETED ON
>>CREATE CURSOR Test (TBL_ID_FLD C(20),TBL_INT_FLD int)
>>INDEX ON TBL_ID_FLD + BINTOC(TBL_INT_FLD) FOR NOT DELETED() TAG Test
>>SYS(3054,12)
>>SELECT * FROM Test;
>>WHERE TBL_ID_FLD + BINTOC(TBL_INT_FLD) LIKE 'asdasdasda%' INTO CURSOR crsTest    && Full
>>?
>>SELECT * FROM Test;
>>WHERE TBL_ID_FLD + BINTOC(TBL_INT_FLD) = 'asdasdasda' INTO CURSOR crsTest        && Full
>>SYS(3054,12)
>>
>
>You see, in my case most queries would be like this:
>
>
>SELECT * FROM Test;
>WHERE TBL_ID_FLD = 'adadfasd' and TBL_INT_FLD = 2 INTO CURSOR crsTest        && Partial
>SYS(3054,12)
>
>
>Does Partial mean that the Rushmore will only use the TBL_ID_FLD portion of the index tag?

Rushmore will only use the left part of a comparison (or of a partial comparison, in the case of AND), if it exactly matches the index expression. So in this case, for optimization, you should have separate indices on TBL_ID_FLD and TBL_INT_FLD.

Unless here, too, there are new features in VFP 9 I am not aware of (sigh).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform