![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
(1) should I have PK on Fact Table ? usually do should - if it makes sense from a database-perspective. |
|
If Yes, then If I have e.g:10 dimension then my PK will have 10 key column ? |
|
(2) Should I have Index on each FK column on Fact Table ? You place an index on columns which occur in (but not limited to) WHERE or |
|
(3) On Product_Dim : should I have Index on ProductCategoryId and SupplierId |
#3
| |||
| |||
|
|
Hi OLAP Gurus, I am designing cube with the snowflake model ( attached below are the samples of the tables ) : Questions are : (1) should I have PK on Fact Table ? If Yes, then If I have e.g:10 dimension then my PK will have 10 key column ? (2) Should I have Index on each FK column on Fact Table ? (3) On Product_Dim : should I have Index on ProductCategoryId and SupplierId ? Thanks for your help, Krist SalesFact : ------------ DateId (FK to Time_Dim) ProductId (FK to Product_Dim) CustomerId (FK to Customer_Dim) SalesAmt Qty Time_Dim : Product_Dim : Customer_Dim : ------------- -------------- --------------- DateId ProductId CustomerId Year ProductName CustomerName Month ProductCategoryId Day SupplierId * ProductCategoryId and SupplierId will be snowflaked to ProductCategory table and Supplier table. |
#4
| |||
| |||
|
|
First of all I would use surrogate keys, it looks like you are using natural keys. I typically do put a column in the fact table with the IDENTITY property. A lot depends on the storage mode you are using for the cube. Keep in mind that if you are using MOLAP, your indexes will not speed up querying the cube but will speed up the processing of that cube. However, those indexes will slow down your ETL work. If you are using the recommended MOLAP, I would not index any other column besides your FK links (and again, only to speed processing) HTH See this link for good info on cube performance - http://www.microsoft.com/technet/pro.../ansvcspg.mspx -- Ray Higdon MCSE, MCDBA, CCNA --- "tristant" <krislioe (AT) cbn (DOT) net.id> wrote in message news:eIrW%23rPAEHA.576 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Hi OLAP Gurus, I am designing cube with the snowflake model ( attached below are the samples of the tables ) : Questions are : (1) should I have PK on Fact Table ? If Yes, then If I have e.g:10 dimension then my PK will have 10 key column ? (2) Should I have Index on each FK column on Fact Table ? (3) On Product_Dim : should I have Index on ProductCategoryId and SupplierId ? Thanks for your help, Krist SalesFact : ------------ DateId (FK to Time_Dim) ProductId (FK to Product_Dim) CustomerId (FK to Customer_Dim) SalesAmt Qty Time_Dim : Product_Dim : Customer_Dim : ------------- -------------- --------------- DateId ProductId CustomerId Year ProductName CustomerName Month ProductCategoryId Day SupplierId * ProductCategoryId and SupplierId will be snowflaked to ProductCategory table and Supplier table. |
#5
| |||
| |||
|
|
- Do you mean PK of the Fact Table is the Identity column ? What if the records in fact table has the possibility of not only inserted but also Updated ? (e.g, due to fluctuation of foreign exchange) |
|
- And PK of the Dimension tables also all are on Surrogate key ? Yes, faster joins with fact and dims thereby allowing faster processing of |
|
Hi Ray, Thanks for the reply. Now I am considering using Surrogate key , - Do you mean PK of the Fact Table is the Identity column ? What if the records in fact table has the possibility of not only inserted but also Updated ? (e.g, due to fluctuation of foreign exchange) - And PK of the Dimension tables also all are on Surrogate key ? Thanks, Krist "Ray Higdon" <sqlhigdon (AT) nospam (DOT) yahoo.com> wrote in message news:Omv8S8QAEHA.1792 (AT) TK2MSFTNGP12 (DOT) phx.gbl... First of all I would use surrogate keys, it looks like you are using natural keys. I typically do put a column in the fact table with the IDENTITY property. A lot depends on the storage mode you are using for the cube. Keep in mind that if you are using MOLAP, your indexes will not speed up querying the cube but will speed up the processing of that cube. However, those indexes will slow down your ETL work. If you are using the recommended MOLAP, I would not index any other column besides your FK links (and again, only to speed processing) HTH See this link for good info on cube performance - http://www.microsoft.com/technet/pro.../ansvcspg.mspx -- Ray Higdon MCSE, MCDBA, CCNA --- "tristant" <krislioe (AT) cbn (DOT) net.id> wrote in message news:eIrW%23rPAEHA.576 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Hi OLAP Gurus, I am designing cube with the snowflake model ( attached below are the samples of the tables ) : Questions are : (1) should I have PK on Fact Table ? If Yes, then If I have e.g:10 dimension then my PK will have 10 key column ? (2) Should I have Index on each FK column on Fact Table ? (3) On Product_Dim : should I have Index on ProductCategoryId and SupplierId ? Thanks for your help, Krist SalesFact : ------------ DateId (FK to Time_Dim) ProductId (FK to Product_Dim) CustomerId (FK to Customer_Dim) SalesAmt Qty Time_Dim : Product_Dim : Customer_Dim : ------------- -------------- --------------- DateId ProductId CustomerId Year ProductName CustomerName Month ProductCategoryId Day SupplierId * ProductCategoryId and SupplierId will be snowflaked to ProductCategory table and Supplier table. |
![]() |
| Thread Tools | |
| Display Modes | |
| |