Subject Re: [firebird-support] Primary Key of character a problem?
Author Ann Harrison
rjschappe wrote:

>Does anyone know if using a PK's of char(20) will cause a problem?
>Our GUID routines creates a 20 char [0..9] sequence.
No, that should be fine, with one caution. Firebird compresses the
prefix of index keys so you'll get much better key density if you order
the bytes from the most likly to be duplicated to the least. For
example, if your GUID were composed of these elements (local count,
machine id, computer manufacturer id, planet id, solar system id, Galaxy
id) you would expect the last three elements to be quite stable, that
there would be a few different values of manufacturer, a few more of
machine id, and few duplicate local counts. If the key is built in
that order, there will be little or no prefix compression. If you
reverse the order, most entries will consiste only of the local
count. It's likely to be a 5:1 difference in packing density - the
density is important not to save disk space, but to make the index more