Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binary index based on field value
Message
From
22/01/2007 18:27:37
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
 
 
To
22/01/2007 03:03:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01187555
Message ID:
01187932
Views:
15
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.

>>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.
Regards N Mc Donald
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform