Subject RE: [IBO] TIMESTAMP question
Author Don Schoeman
What happens when a generator reaches it's top limit (which I assume is an
Integer value), does it wrap to 0 or to it's negative limit? With the speed
that recording could potentially occur at, this is quite an important factor
to consider before using a generator to generate a primary key for this

Don Schoeman

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 10 December 2004 01:39 PM
Subject: RE: [IBO] TIMESTAMP question

At 12:17 PM 10/12/2004 +0200, you wrote:

>Thank you Helen, I'm well aware of the fact that using the client's time is
>never good practice. This project is currently only a proof of concept and
>for now the software will always run on the same machine as the Firebird
>server. I personally also didn't like the idea of using a floating point /
>timestamp value as a primary key but I just don't see an easy way around
>this. At first I used two separate integer fields (Delphi's TDateTime
>integral and decimal parts split-up) but that causes difficulty in sorting,
>so I ended up going the TIMESTAMP route. Now that you mentioned that the
>timestamp on the server always returns zero milliseconds I might have to
>start re-thinking the DB design.

Do you know about generators and primary keys? Do you understand that, in
a RDBMS likeFirebird, your primary key does not determine the storage order?

You can (and should, in dynamic tables) use a primary key that has no
meaning as data. Any field that you need to order by in queries can be
indexed, if it is sensible to do so. However, the db engine does not need
indexes in order to sort or search; and keys are not indexes (although
they do have mandatory indexes to enforce them).