Foreign Keys in the Datawarehouse

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  data warehouse design   » Foreign Keys in the Datawarehouse

Foreign Keys in the Datawarehouse

Topic RSS Feed

Posts under the topic: Foreign Keys in the Datawarehouse

Posted: 6/9/2011

Jedi Youngling 10  points  Jedi Youngling
  • Joined on: 3/25/2010
  • Posts: 5

I personally like having PK-FK in the Datawarehouse. Apart from maintaing data integrity, these relationships make building the cubes pretty easy :). I would like to what other people in the forum do with their datawarehouse. 

Is it a good idea to have Primary Key-Foreign Key relationships between dim and fact tables in the DWH? and if so, should the PK-FK be defined before the fact table is loaded. Or should Foreign keys be dropped before the data is inserted into the fact tables, and then re-created after the fact table has been loaded and indexed. 

I am wondering if the data integrity should be handled during ETL and get rid of PK-FK constraint in the DWH to improve loading times. Is there a performance gain/ loss in inserting data into a fact table which has Foreign Key constraints Vs. Loading the data and then creating the foreign keys?


Posted: 6/11/2011

Padawan 734  points  Padawan
  • Joined on: 6/6/2011
  • Posts: 42

Here is a brief article that deals will the idea of fine tuning a data warehouse.

 

http://www.information-management.com/issues/20060101/1044293-1.html  -good info

 

http://stackoverflow.com/questions/2819424/in-a-star-schema-are-foreign-key-constraints-between-facts-and-dimensions-necces The answer to your questions is yes and no. It seems that there is a bit of debate on constraints so you may have to be innovative in finding what solution will work best.

If this answers your question please click answered.

 

 


Posted: 6/13/2011

Jedi Youngling 10  points  Jedi Youngling
  • Joined on: 3/25/2010
  • Posts: 5

Thanks for your post. The links provide useful information!

Before posting on BIDN, I read the article on stackoverflow. That discussion makes strong points for both sides of the argument. I am hoping that people on BIDN can share their own experiences with how they handle Foreign Keys in the Datawarehouse. As I said, I like them because they provide data integrity and make life much easier as a cube developer. On the other hand people have pointed out the "foreign keys will slow inserts and updates so that a fact table becomes too slow to load especially as it increases in size."

I understand that it depends on what kind of design we have, and how big is the data set and how the loading process is designed. It's not that one way is right and the other one is absolutely wrong. I am hoping to learn from other Datawarehouse designers/ Developers as to where their preference lies on this issue.


Page 1 of 1 (3 items)