Hi all,
I'm confused in following writing.(under the underline)
It means The fact table doesn't need PK at all?
what situation Should I need PK to control integrity check?
or I just use the primary index to do that?
thank very much.
---------------
Actually, the fact table doesn't need a primary
key. The collection of foreign keys on a fact
table can be thought of as the primary key, if
you really need to say you have on, but it isn't
necessary.
The only reason for a primary key in a
dimensional warehouse is if you have something
else with a foreign key pointing to it. This is
not the case with a fact table.
If you are trying to use the key to associate
rows between fact tables, you are going to get
yourself into trouble. Fact tables should be
associated across common conforming dimensions
otherwise, not only do you no longer have a
dimensional model, but you would be required to
rebuild such associations should changes in the
granularity of one of the tables occurs.
Besides, fact table relationships are generically
many-to-many, which cannot be represented by a
simple primary key relationship.
I'm confused in following writing.(under the underline)
It means The fact table doesn't need PK at all?
what situation Should I need PK to control integrity check?
or I just use the primary index to do that?
thank very much.
---------------
Actually, the fact table doesn't need a primary
key. The collection of foreign keys on a fact
table can be thought of as the primary key, if
you really need to say you have on, but it isn't
necessary.
The only reason for a primary key in a
dimensional warehouse is if you have something
else with a foreign key pointing to it. This is
not the case with a fact table.
If you are trying to use the key to associate
rows between fact tables, you are going to get
yourself into trouble. Fact tables should be
associated across common conforming dimensions
otherwise, not only do you no longer have a
dimensional model, but you would be required to
rebuild such associations should changes in the
granularity of one of the tables occurs.
Besides, fact table relationships are generically
many-to-many, which cannot be represented by a
simple primary key relationship.