Subject | Re: [ib-support] Generating a unique ID |
---|---|
Author | Marco Lauria |
Post date | 2001-11-09T15:33:09Z |
At 15.25 09/11/2001 +0000, you wrote:
With IB6 and 64Bit Integers I think that getting an overflow is almost
impossible....
imagine how much is 2^64.....
Using time stamp it's possible to have duplicates....
If two people inserts at the same time...
it's difficult but possible.
Regards
Marco Lauria
P.S. I usually use as primary key a NUMERIC(18,4) column that is stored
into a 64Bit
INTEGER and fill it with a generator.
>Hi,In IB/FB you use generators.
>
>I'm not that very used to DB and I always created an autoincrement
>field as an unique key. But... I know that at a certain moment and
>depending on how many entries a table will get, there is a chance you
>get a numeric overflow... now I'm wondering how is this done in those
>big databases? How is this handled... or is this just not possible
>and do all thos big databases use a combination of fields as a unique
>key?
>
>Is using a timestamp a good idea?
>Is using a GUID a good idea? How to create a GUID with Firebird?
>
>Perhaps above suggestions (timestamp, GUID) are stupid ideas, but
>what is the best thing to use as a unique key?
>
>Are there also some naming rules concerning tables/fields which are
>interesting to follow by someone who wants to learn something from
>the experience of guru's in the database field?
With IB6 and 64Bit Integers I think that getting an overflow is almost
impossible....
imagine how much is 2^64.....
Using time stamp it's possible to have duplicates....
If two people inserts at the same time...
it's difficult but possible.
Regards
Marco Lauria
P.S. I usually use as primary key a NUMERIC(18,4) column that is stored
into a 64Bit
INTEGER and fill it with a generator.