Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore and composite index tag
Message
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:
01304566
Views:
15
>Hello fellow weekend-workers <g>,
>
>I am changing a candidate key on many of my tables from a single field to a composite expression (e.g. TBL_ID_FLD + BINTOC(TBL_INT_FLD)). My question is, do I also need to create a regular index on the TBL_ID_FLD in order for Rushmore to find records faster? That is, will Rushmore use the composite index key? (and if so, I can save on not having to create an extra index tag).
>
>Thank you in advance for any questions.


It depends what is your WHERE clause:
CLEAR
CREATE CURSOR Test (TBL_ID_FLD C(20),TBL_INT_FLD int)
INDEX ON TBL_ID_FLD + BINTOC(TBL_INT_FLD) TAG Test
SYS(3054,12)
SELECT * FROM Test;
WHERE TBL_ID_FLD = 'asdasdasda' INTO CURSOR crsTest
?
SELECT * FROM Test;
WHERE TBL_ID_FLD + BINTOC(TBL_INT_FLD) = 'asdasdasda' INTO CURSOR crsTest
?
SELECT * FROM Test;
WHERE TBL_ID_FLD LIKE 'asdasdasda%' INTO CURSOR crsTest
?
SELECT * FROM Test;
WHERE TBL_ID_FLD + BINTOC(TBL_INT_FLD) LIKE 'asdasdasda%' INTO CURSOR crsTest
INDEX ON TBL_ID_FLD  TAG Test
?
SELECT * FROM Test;
WHERE TBL_ID_FLD = 'asdasdasda' INTO CURSOR crsTest
?
SELECT * FROM Test;
WHERE TBL_ID_FLD LIKE 'asdasdasda%' INTO CURSOR crsTest
SYS(3054,12)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform