Subject what kind of primary key?
Author frische_brise2003
Hi, all.

the dbs of my costumer are organized in a
Hub-and-Spoke scenario. The databases will
all be replicated among each other.

Because of records of the same table can be created in every
database it is necessary to have a unique primary key for the
records. My idea is to create a compound PK which consists
of an ID which is specific to the database in which the record
is created and a value created by a generator.

My questions:
1) Is this a good idea or causes it problems?
2) Is it better to store the compound PK in a VARCHAR column (e.g.
"1_45" with db ID = 1 and 45 generated by a generator) or to use two
INTEGER columns and define the primary key as the combination of the
two columns?
- How will the use of a VARCHAR column as PK in my tables affect the
speed of my queries?

Any help appreciated.

Regards

Jürgen