![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've been struggling with why I need one of these. All of Ralph's writings say the PK is the a composite of the dimension FK's. Well OK, but why define one at all? All my queries are sums or counts. Any thoughts? |
#3
| |||
| |||
|
|
I've been struggling with why I need one of these. All of Ralph's writings say the PK is the a composite of the dimension FK's. Well OK, but why define one at all? All my queries are sums or counts. Any thoughts? |
#4
| |||
| |||
|
|
dataman wrote: I've been struggling with why I need one of these. All of Ralph's writings say the PK is the a composite of the dimension FK's. Well OK, but why define one at all? All my queries are sums or counts. Any thoughts? It's difficult for me to visualize the table structure you are talking about, based on that description. There is not enough context to know what you mean by several of the terms you use (such as "fact table"). But in general, you do need a PK in a table. Otherwise, you may end up with duplicate identical rows, and also there will be no way of addressing individual rows. A primary key is a way to identify each row uniquely. This can be a "natural key" which is some column (or columns) which is unique over the table. Or it can be a "pseudokey" which is typically a monotonically increasing integer column. In some tables, foreign keys to other tables form a sensible choice for a composite primary key. Regards, Bill K. Fact table refers to Ralph Kimball's dimensional modeling |
#5
| |||
| |||
|
|
Fact table refers to Ralph Kimball's dimensional modeling for analytics/data mining reporting. I wholeheartedly agree the a PK is requisite for OLTP modeling. It's 1NF. But in dimensional modeling I don't think I need one. I never do updates, only inserts managed through ETL load processes. Thanks for the replies. |
#6
| |||
| |||
|
|
dataman wrote: I've been struggling with why I need one of these. All of Ralph's writings say the PK is the a composite of the dimension FK's. Well OK, but why define one at all? All my queries are sums or counts. Any thoughts? It's difficult for me to visualize the table structure you are talking about, based on that description. There is not enough context to know what you mean by several of the terms you use (such as "fact table"). But in general, you do need a PK in a table. Otherwise, you may end up with duplicate identical rows, and also there will be no way of addressing individual rows. A primary key is a way to identify each row uniquely. This can be a "natural key" which is some column (or columns) which is unique over the table. Or it can be a "pseudokey" which is typically a monotonically increasing integer column. In some tables, foreign keys to other tables form a sensible choice for a composite primary key. Regards, Bill K. Fact table refers to Ralph Kimball's dimensional modeling for analytics/data mining reporting. I wholeheartedly agree the a PK is requisite for OLTP modeling. It's 1NF. But in dimensional modeling I don't think I need one. I never do updates, only inserts managed through ETL load processes. Thanks for the replies. |
![]() |
| Thread Tools | |
| Display Modes | |
| |