GUID Factory

Christopher Browne cbbrowne@hex.net
Sun, 17 Dec 2000 11:41:10 -0600


On Sun, 17 Dec 2000 10:09:04 CST, the world broke into rejoicing as
grib@gnumatic.com (Bill Gribble)  said:
> On Sat, Dec 16, 2000 at 12:05:42PM -0500, David Merrill wrote:
> > Obviously, the current algorithm is working. So there is  no reason to
> > change it, but I'm doing essentially a new implementation of that
> > code, so I want to make sure it is solid in all respects. Possibly
> > postgres has a built-in guid factory as Oracle does, and this is a
> > nonissue anyway, so let's not argue over it. :-)
> 
> I don't understand.  Why are you doing a new implementation of the
> GUID algorithm?  I thought you were designing a database structure for
> storing gnucash's data structures; if that's the case, the GUID is
> just more data that needs to be stored, isn't it?  Is there something
> I missed?

I'm not sure why this represents something that has to be generated by
the DB engine, and it frankly seems very _unimportant_ how efficient
it is.  After all, the ID gets created _once_, at the time that the
transaction is first generated.

If it took 20 minutes to generate each one, we could spawn a process that
does so 24h/day, pushing them onto other hosts, if needed, to generate them
behind the scenes, queueing them up for when they're needed.  

Now, 20 minutes is a _preposterous_ estimate; it's more likely that
"efficient" versus "inefficient" represents the difference between a few
nanoseconds and a few milliseconds.  Which, I should point out, represents
a factor of a million; six-odd orders of magnitude, with both quantities
of time being invisibly short from the perspective of human perception.

This is something that is indeed appropriately generated in the "engine,"
not in the DB; the relevance to the DB is to ask whether it can use the
GUID as one of its keys, and whether or not the DB supports foreign keys.
--
(concatenate 'string "cbbrowne" "@ntlug.org")
<http://www.hex.net/~cbbrowne/>
"Bother," said Pooh as he struggled with sendmail.cf.
"It never does quite what I want."
"I wish Christopher Robin were here.".