Constraints on Surrogate Keys?
3 posters
Page 1 of 1
Constraints on Surrogate Keys?
What is the best practice for setting foreign key constraints in the dimensional model? Should I define the surrogate key as a primary key in the dimensions, and as a foreign key in the fact, or not?
Thanks in advance!
Thanks in advance!
ebry74- Posts : 5
Join date : 2011-06-20
Re:Constraints on Surrogate Keys?
Hi,
putting a foreign key on a fact table will help as it will put a check where the data from a dimensin will not be deleted by accident if it is being used in a Fact table. It may help in query performance only drawback when trying to insert in the fact it will slow down the performance.
thanks
putting a foreign key on a fact table will help as it will put a check where the data from a dimensin will not be deleted by accident if it is being used in a Fact table. It may help in query performance only drawback when trying to insert in the fact it will slow down the performance.
thanks
hkandpal- Posts : 113
Join date : 2010-08-16
Re: Constraints on Surrogate Keys?
Since you go through the bother of assigning surrogate keys, there is no point in enforcing FK relationships. However, it is sometimes useful to declare them (without enforcement) to aid the optimizer.
Under NO circumstances should you delete dimension rows without a process in place to also purge facts. In general, there is no benefit of deleting dimension rows under normal circumstances. You simply will not recover significant space to make much difference.
Under NO circumstances should you delete dimension rows without a process in place to also purge facts. In general, there is no benefit of deleting dimension rows under normal circumstances. You simply will not recover significant space to make much difference.
Similar topics
» Surrogate keys in dimension and fact table
» No Surrogate keys
» Surrogate Keys in ODS and Dimension
» Surrogate keys for degenerate dimensions?
» Resetting Dimension Surrogate Keys
» No Surrogate keys
» Surrogate Keys in ODS and Dimension
» Surrogate keys for degenerate dimensions?
» Resetting Dimension Surrogate Keys
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|