>>When using two numeric values for a compound index it is typically better to separate the numbers with a delimiter, ie.
>>
>> ALLT(STR(field1)) + "-" + ALLT(STR(field2))
>>
>>Otherwise, your seeks will rarely get you the result you want. Note that the ALLTRIM() is used to reduce the size of the CDX file.
>>
>>-David
>
>David:
>
>A delimiter is absolutely necessary if you use allt() in your index expression because
>
>allt(str(1)) + allt(str(23)) is exact than allt(str(12)) + allt(str(3))
>
>But if you dont use allt() is not necesary at all. I use str(field1) + str(field2) in several tables and all my seeks works fine always.
>Carlos.
Carlos,
Some of my tables have more than 3.5 million records so the CDX becomes very large. On average the ALLTRIM() reduces the size of my CDXs by forty percent because STR() pads strings to the left with 10 spaces. Note: You'll have to reindex after adding the ALLTRIM() to see the size reduction.
However, I did test the seeks on a sample table and you are quite right, it works fine. I guess I established the opinion from some faulty expiraments long ago. If I rediscover the reason for my previous opinion I'll pass it on...
David
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only