Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary index based on field value
Message
De
22/01/2007 03:03:24
 
 
À
21/01/2007 20:10:51
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:
01187580
Vues:
24
This message has been marked as the solution to the initial question of the thread.
>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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform