Subject sharing generators between tables
Author csswa
Are there any drawbacks to sharing a generator between several tables
for PK generation? I figured that if I have a bunch of low-turnover
tables, I can have them all use the same gen (e.g. GEN_SHARED) for
their PK field.

The only thing I can think of is the potential large jumps in a
table's PK values, e.g.

TABLE A
PK
---
3
4
5
455
456
457

which is just an aesthetic consideration with no practical
implication, as far as I can tell (it's like an exaggerated version
of the gaps resulting from rolling back after a gen_id() call).

One minor benefit of using a shared gen would be that you would know
not only the order that the records were created in each table, but
the order in which all records in all tables sharing the gen were
created. I'm pressed to find a reason where this could be of use,
but it might come in handy.

Is sharing gens a common or bad practice? If this is a bad idea, I'd
prefer to find out now before I implement it.

Also, I recall reading something about a limit to the number of
generators you can have in a database (127 is the number that sticks
in my mind) ...?

Thanks,
Andrew Ferguson

P.S. Apologies for any confusion caused by my previous postings which
contained strange-looking metadata examples. Until recently I have
been using IBConsole, and I was cut'n'pasting the metadata as
displayed by it, hence the appearance of doublequotes and odd
arrangement of metadata. Unfortunately, I should have been quoting
my original DSQL entries and not the resulting metadata, as
interpreted by IBConsole. I've since switched to the wonderful IB-
SQL (thanks Helen and Jason!).