Subject | RE: [firebird-support] Re: Primary Key - GUID |
---|---|
Author | Alan McDonald |
Post date | 2006-01-25T22:41:55Z |
> Jason Dodson wrote:for not just strings:
>
> >Do you understand the implications of using a string as a primary key?
> >
> >Jason
> >
> >
> >
> >
> Ok, I'm hooked! What are the implications of using a string as a primary
> key?
>
> Ivan.
storage - they take up more space but space is cheap, backup/restore times
get longer, v2 B/R times are getting faster.
sequence - (GUID/UUID) they are indexable but they do not provide a
sequence - so you may need a datetime stamp field + index to achieve this -
more storage, more time
you may be creating PKs on the server as well as the clients - will they use
the same method?
If you've examined your expected insert rate carefully you may realise that
GUID/UUID uniqeness guarantee may well be shorter than using BIGINT PKs
UUIDs have reverse order selectivity and have a UDF for server generation
(see ibphoneix site) and are better for FB indexing than GUIDs which are
popularly used for client side generation.
ah... and they look stupid and mean little when you are reviewing data
:-)... when a client says they have a problem with a particular record you
need some other means of uniquely identifying the record than asking the
client to read out a UUID to you so you can find it - then you have to
retype it carefully to select it - painful
Alan