Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore and composite index tag
Message
 
À
22/03/2008 12:20:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01304565
Message ID:
01304568
Vues:
19
>>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.
>
>Hi Dmitry,
>
>The potential problem is the following. If the key is made up of data provided by the user, you will need to filter the index on not deleted(). Otherwise, if the user deletes the record and creates a record with the same key again, he will get an error message to the effect that the record already exists.
>
>A filtered index can't be used for Rushmore optimization.
>
>On the other hand, it is a little doubtul that you will do a query precisely on the expression you specified - unless you use the exact expression explicitly.

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)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform