Subject RE: [IBO] Re: Multiple dbs and system wide unique keys
Author Brian K. Woods
Thanks for your input, Alan and Svein. You guys are too hilarious! @;-)
Actually, Alan, I was just being facetious when I used the Y2K analogy. I'm
sure
in practice you are right in that your users will never hit the limit.
The major reason I _try_ (sometimes you can't help it!) to stay away from
such
things is that it is not self-documenting. Some contractor or savy user
years from
now could go in and look at your database and not realize that your system
expects there to be
multiple generators all staggered apart like that.

Anyway, after some more planning and test data pumping, I think I'm going to
go
with something along the lines of Eric Handbury's method of local databases
only knowing about their own keys
and putting it all together on the server. That allows me to use single
field integer keys for
optimal speed and easier join syntax down the road.

Thanks for all the input,
Brian

> -----Original Message-----
> From: Alan McDonald [mailto:alan@...]
> I can understand the fear...
> but I think the Y2K issue has been flogged to death..
> the reality in my case is that 4 locations inserting 30,000 records a year
> per table, worst case (I increase that to 100,000) means I can go on
> inserting for the next 5,000 years without having my PKs clash. I
> think I'm
> pretty safe...The last 4 years has proved my expectations quite sound, I'm
> safe now for the next 6,000 years. Hope Bill Gates is still doing his best
> by then :-)
> Your situation may be different...
> If 64bit integers had been available I might have been safe for another
> 15,000 years. I know I know you neer can tell.
>
> Alan

> -----Original Message-----
> From: Svein Erling Tysvaer
> I'm not favouring this solution, but your fear could be easily avoided by
> setting the generator at the first location to 1, the second to 2 etc. and
> then make sure you increase your generator by gen_id(<generator_name>,
> 1000) all the time. If there is any chance you will ever get more
> than 1000
> locations, use a higher number. Basically it is the same as what Alan
> suggested, just changing your 'Y2K scare' from #items to #locations (and
> then I thought it was possible to use 64-bit numbers).
>
> Set