Sunday, March 11, 2012

Assigning PK and FK

Hi,

I have three tables -

Table A
Col1...Col2
1....A
2...B

Table B
Col3...Col4
1....X
2...Y

TableC
Col1...Col3...Col5...Coln
1......1.........H...Y.

A&B serve as the parent table for C. A&B are the dimension tables and C is the fact table. How do I assign the PK and FK in EM?

ThanksBOL:

Referential Integrity

Referential integrity must be maintained between all dimension tables and the fact table. Each fact record contains foreign keys that relate to primary keys in the dimension tables. Every fact record must have a related record in every dimension table used with that fact table. Missing records in a dimension table can cause facts to be ignored when the dimension table is joined to the fact table to respond to queries or for the population of OLAP cubes. Queries can return inconsistent results if records are missing in one or more dimension tables. Queries that join a defective dimension table to the fact table will exclude facts whereas queries that do not join the defective dimension table will include those facts.|||Any adivise on how to index the dimension tables and fact tables based on PK and FK?|||Originally posted by vivek_vdc
Any adivise on how to index the dimension tables and fact tables based on PK and FK?

PK for every dimension table (PK creates own index). Index for every foreign key in fact table if fact table is going to be big.|||So if I have 5 FK's on the Fact table then -

1. I should have a clustered index on those 5 keys together OR
2. Have 5 different indexes for each of the 5 keys.|||I'm sorry....since a warehouse is built with code (I don't have Enterprise, and have never built one with it) and is wrapped by the contraints of that code, why do we need RI?

Just curious...especially since warehouses for the most part are read only...(except for the batch builds)

I know I must be missing something here...

No comments:

Post a Comment