TIP: Feature request: Collation settings on connection level

Bart Pietercil bart.pietercil at gmail.com
Tue Jun 19 05:16:12 CDT 2007


On 19-jun-07, at 12:07, Ruslan Zasukhin wrote:

> On 19/6/07 1:01 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua>  
> wrote:
>
>>> now for this last example I think your suggestion works
>>> TIP:
>>>      you can make virtual field (Table Method) and specify
>>>      for it other location, then its index will be DIFFERENT.
>>>      Payment for this -- overhead to maintain this index.
>>>
>>> I don't really see how I can specify for a field a collation but  
>>> will
>>> look into it
>>>
>>>
>>> I understand your problem, but I am sure I worked with databases
>>> (don't remember which one) that permitted me to define indexes for a
>>> given collation and let me specify what index to use when doing a  
>>> sort.
>>
>> No problems here for Valentina also.
>>
>> You make Table Method,
>>
>>     fld2 = tbl.CreateVarCharField( "fld2", 2044, fIndexed, "fld1" )
>>
>> "fld1" - is FORMULA, i.e. Value of fld2 virtual field will be
>>             the same as fld1.
>>
>> And now you say:
>>
>>     fld2.CollationAttribute( ... )
>>
>> This 2 steps effectively just create on disk ONE MORE index,
>> Which now will work by this new collation.
>>
>> And now you CAN CHOOSE what index to use in what query.
>> In fact you do this via name of field
>>
>>     ORDER BY fld1   -- German
>>     ORDER BY fld2   -- French
>
> Another TIP:
>
> It is better even improve formula, in case if you really need  
> German index
> only for GERMAN records. May be something as:
>
>   fld2 = tbl.CreateVarCharField( "fld2", 2044, fIndexed,
>                 "if( fld_lang='de', fld1, NULL )"
>
> I.e. Formula selects only German records, all rest are NULL, and  
> they eat
> ZERO disk space and TIME in the index.


OK, I see the solution

THX

Bart
PS: Get ready for my next mail(s) :-)




More information about the Valentina mailing list