Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary index based on field value
Message
De
23/01/2007 06:43:39
 
 
À
22/01/2007 18:27:37
Neil Mc Donald
Cencom Systems P/L
The Sun, Australie
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:
01187555
Message ID:
01188022
Vues:
22
>Hi,
>Thanks for your solution it works well.
>For the record, on a 1GB dbf it reduces the CDX by approx 4MB, but makes little or no difference with the performance.
>

This work only if osbalance is not nullable.


>>>Hi,
>>>With binary indexes are you able to create a logical binary index based on the value of a numeric field i.e. IIF(osbalance=0,.F.,.T.) and have rushmore optimize it within a select.
>>>i.e. Select * from invoice where osbalance=.T.
>>>
>>>It would save a lot of space in the index and should be faster as well.
>>
>>Yes, you can use a binary index in this case. However, you can simplify your index expression a lot.
>>IIF(osbalance=0,.F.,.T.) can be simplified to osbalance#0, in other words
>>Index on IIF(osbalance=0,.F.,.T.) tag yourtag && will work, but "overkill"
>>Index on osbalance#0 tag yourtag && much shorter and faster
>>The same simplifiation can be used in many cases which many programmers clearly are not aware of.
>>lValue=.T.
>>?lValue=.T. && Bad code
>>?lValue && Good code
>>Unfortunately youi can not set order to a binary index, but a binary index will be used to optimize queries.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform