Subject Re: [Firebird-Architect] GUID Key Fields
Author Daniel Albuschat
On Mon, 21 Mar 2005 21:27:41 -0800 (PST), Kevin Berry
<kevinbe71@...> wrote:
>
> Thanks for the reply...
>
> However, one of the benefits of SQL Server's GUID type
> is that it is stored internally as a 128-bit number.

Well, this could be possible with firebird, too.
You simply need a set of UDFs to convert a hex representation
to/from the 128-bit number (maybe in a char(16) without
a character set applied, or so. I think there's no 128-bit integer
in firebird, is there?).

> Storing it as a hexadecimal character field will
> require at least 32 characters and if you want to
> store it in the typical GUID form you need 38
> characters. The nice thing about SQL Server's support
> is that you simply insert the GUID as if it is a
> string and it will be converted to the 128-bit number
> internally automatically. This would be very useful
> in Firebird. It'll be much more efficient as well
> (using less than half the bytes) than the alternatives
> - much better for indexing as well.

I think the char(16) version should work reasonably fast, too.
If there *is* a 128-bit integer in FB, it should be about the
same with some GUID-conversion UDFs.

Bye,
Daniel

--
eat(this); // delicious suicide