Subject | Re: [ib-support] OID: Double or String? |
---|---|
Author | Ann W. Harrison |
Post date | 2002-08-28T21:02:34Z |
At 03:22 PM 8/28/2002 -0500, Guillermo Najar-Arreola wrote:
opinion, is to create a compound key. The first part of the key is the
computer id, something that you assign and store in an integer field. The
second part of the key is a value created by gen-id on each system and
stored in an eight byte integer field. Because Firebird uses prefix
compression on indexes, the initial "computer id" part of the key will
almost never be stored and will have no measurable effect on index size.
Eight byte integer - aka numeric (18,0) - is the best choice for an index
key type in general because it's precise and dense. Firebird manipulates
the keys it receives so they can be compared bytewise - inverting bytes
and performing unnatural acts on floating point numbers. The stored key
has both prefix compression and suffix compression. Suffix compression
is applied to each part of a compound key. As a result, the stored key
values vary in size...
Regards,
Ann
www.ibphoenix.com
We have answers.
>I'm planning how am I going to implement OIDs for any of my apps usingObject identifiers can be implemented in several ways. The best, in my
>Firebird. I was thinking on strings since I have customers with laptops that
>download their information to a central server and I want to prefix the OID
>comming from each computer so I don't have conflicts with OIDs generated in
>the central server. For Interbase, what data type is more efficient for
>primary keys ? double or string?
opinion, is to create a compound key. The first part of the key is the
computer id, something that you assign and store in an integer field. The
second part of the key is a value created by gen-id on each system and
stored in an eight byte integer field. Because Firebird uses prefix
compression on indexes, the initial "computer id" part of the key will
almost never be stored and will have no measurable effect on index size.
Eight byte integer - aka numeric (18,0) - is the best choice for an index
key type in general because it's precise and dense. Firebird manipulates
the keys it receives so they can be compared bytewise - inverting bytes
and performing unnatural acts on floating point numbers. The stored key
has both prefix compression and suffix compression. Suffix compression
is applied to each part of a compound key. As a result, the stored key
values vary in size...
Regards,
Ann
www.ibphoenix.com
We have answers.