Re: [PATCHES] Patch for UUID datatype (beta) - Mailing list pgsql-hackers

From mark@mark.mielke.cc
Subject Re: [PATCHES] Patch for UUID datatype (beta)
Date
Msg-id 20060919211213.GA14890@mark.mielke.cc
Whole thread Raw
In response to Re: [PATCHES] Patch for UUID datatype (beta)  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Tue, Sep 19, 2006 at 10:11:39AM -0400, Andrew Dunstan wrote:
> mark@mark.mielke.cc wrote:
> >>As others have mentioned, using MAC address doesn't remove the
> >>possibility of a collision.
> >It does, as I control the MAC address. I can choose not to overwrite it.
> >I can choose to ensure that any cases where it is overwritten, it is
> >overwritten with a unique value.
> How do you know somebody else isn't using that MAC value?

Different UUID forms can be unique within their domain. As long as I
control the MAC address assignment for all of my units, my MAC address
can be guaranteed to be unique across space and time, within the
generous range provided by a UUID. My UUIDs may not be unique in your
database, or in your domain, but they will be unique within mine.

If I use a UUID form based upon the MD5 or SHA-1 of a unique URL, there
is a great chance that it is unique. Better than that of a random number
generator, in that I control the URL.

I'm not in favour of the random number based UUID forms, as I believe
I am sacrificing control, thereby allowing for generation to result in
non-unique output. Where it is currently impossible for me to generate
the same UUID (I control the MAC address, time, and the generator uses
the clock sequence), using a random number generator turns the
impossibility into a possibility.

If you don't have control over the MAC address, time, or generator,
then yeah - random number generator might suffice.

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



pgsql-hackers by date:

Previous
From: Mark Wong
Date:
Subject: Re: Lock partitions
Next
From: Andrew - Supernews
Date:
Subject: Re: [PATCHES] Patch for UUID datatype (beta)