Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    176

    Unanswered: 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?

    Thanks

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    BOL:

    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.

  3. #3
    Join Date
    Sep 2003
    Posts
    176
    Any adivise on how to index the dimension tables and fact tables based on PK and FK?

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    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.

  5. #5
    Join Date
    Sep 2003
    Posts
    176
    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.

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •