Subject Re: [firebird-support] uniqueidentifier data type and performance
Author Milan Babuskov
martinthrelly wrote:
> hello there. we are considering porting a project to Firebird 2.0. the
> only stumbling block for us is regarding the uniqueidentifier data type.

Create a two-field identifier: one field for the SITE_ID (or server id)
and the other field filled with sequential numbers (or characters) by
generator.

If two fields are too much, you can use a single field and partition the
space:

server one uses interval: 0 - 1.000.000.000
server two uses interval: 1.000.000.000 - 2.000.000.000
etc.

I used one bilion here, but you can have much bigger segments (64bit
integer is a very large number).


I find 64bit integers much easier to control and maintain than GUIDs.
Main benefits are:

a) it is built into server via GENERATORs - no need for external stuff
b) you can easily tell where the data is coming from
c) you have an actual sequence 1, 2, 3, 4... so it's easy to see gaps
and other problems that might occur

I also believe that indexes are smaller/faster, but I don't know that
much of internals to be 100% sure.

--
Milan Babuskov
http://www.guacosoft.com
http://www.flamerobin.org