Subject RE: [ib-support] Guid Support in Firebird
Author Leyne, Sean
> I have been looking into guid support and noted a number of things:
>
> 1. There is outstanding feature request for this.

Yep -- it's one my own personal requests.


> 2. Normal guids (generated using mac address etc) are not optimised
> for firebird indexes, they need to be reordered.

I think that this is really platform/OS dependent.

Interestingly (depending on your point of view) _I thought_ I heard that
MS had changed there logic along the way, due to the relatively "static"
nature of there GUID which they returned/created. So the 'format' of
their GUID might change depending on the OS version.


> 3. A number of third party UDF's exist to create guids for windows.
> I have been unable to find one for linux.
> 4. Linux has a library to create guids, libuuid. It is part of the
> e2fsprogs package.
>
> To implement guid support cross platform either a udf is required
> which does different things on different platforms or the engine
> needs to be extended to do the same.

Quite correct, unfortunately, adding new system functions has been
targeted towards a v2.0 release (there have been some exceptions), and
not the next v1.5 release.


> Would it be possible to re-use the GEN_ID function with no
> parameters to generate a guid? is it desirable?

Please elaborate on your proposed solution/idea.


> How should a guid be stored in the database, should a new
> datatype be created?

Given that a GUID is a 128bit integer (Large Large Integer ???) storing
it as a numeric values won't fly (until a new base datatype is created
-- which requires a ODS change, which requires...).

So, you're left with storing the value as a CHAR, the only question is
whether you want to store a formated value "xxxx-xxx-xxx-xxx..." or
unformated "xxxxxxxxxxxxxx..."?

The answer to this question depends on how you feel about transcribing a
26 or 31 char value by hand (without making a mistake). As far as the
system/indexing is concerned, the difference between
formatted/unformated is not worth thinking about. So, the answer is
really a personal choice. {My own vote would be for a formatted value}


Sean