Subject Re: [firebird-support] Re: how do i speed this up?
Author Alexandre Benson Smith
martinknappe wrote:
> Hi,
> now I have an idea; a bit complicated to explain, but does any one
> know how I could achieve the following FROM WITHIN A TRIGGER:
>
> -get the collation key of a varchar object
> -convert the key into a one-byte-per-char string (i.e. each character
> is "calculated" by using the byte as and index into ascii)
> -append a 4-byte (big) integer object likewise to this string
>
> the thing is, i am really using NOT unicode_fss collation, but my own
> unicode collation which i wrote according to David Schnepper's paper
> (see here:
> http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_collation); i
> included unicode_fss in the script so no one gets confused by my
> collation's name...
> Now, my collation GUARANTESS that the collation key of a unicode_fss
> object is exactly as long (in bytes) as there are number of characters
> (NOT BYTES) in the unicode_fss string. So an 80-character string would
> have a collation key of 80 bytes, no more...
> And my idea is to introduce a new field in table dicentries which
> would be calculated from column asterm and id each time an entry in
> dicentries is inserted or modified
> Assuming this new field was called "ASTERMCOLLATE", instead of writing
> "order by asterm, id", I could simply write "order by
> ASTERMCOLLATE"..and because this column could be sorted by codepoint,
> it would even be possible to easily create an index on it
>
> I hope some of you can help me,
> thanx,
>
> Martin
>
>
>
Martin,

I think you should try FB 2 because it has a new INTL Interface, that
handles correctly Unicode chars. I think you will spend energy unecessary.

Even if you need your own collation, it will be far more simple with the
new INTL Interface design.

And with FB 2 the 252 bytes index size are gone.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br