Subject RE: [firebird-support] basic question for database design
Author Alan McDonald
> in my current project (approx 120 datatables) I use integers,
> generated through triggers and generators as primary indizes in every
> table. My questions :
>
> 1.) Are there any arguments for or against to use one generator for
> all tables, or should I use several generators? Or maybe one generator
> for every table?

I always find it better housekeeping to have one generator per table but for
some small lookup/static tables I'm happy to use only one generator amongst
them all.

>
> Interbase data definition guide says 2.147.483.647 possible positive
> integers values, that should be enough for my amount of data, and
> INT64 gives me a number I can not even pronounce...
>
> 2.) I have read something about the concept of meaningless primary
> indizes, but in master-detail relation of two tables, I use primary
> index of master table for defining master-detail relation. Do I break
> this concept with this? Do I have to add another data-column to define
> master-detail relation?
>
>

You mention index when you probably mean primary key - with a PK you
automatically get a unique asc index as well.
I always use the primary key of the master table as the foreign key to the
child records. The child records have their own PK provided by their own
generator.

You choose the integer size (integer, int64) you want for the purpose.

This "meaningless" PK in both cases I sometimes expose to the client
application and use it as a means of tracking records down but they never
have meaning in my apps as far as the client is concerned.
Alan

> Any suggestions, or comments on this?
>
> Regards - Ulrich
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>