Fact table structure
3 posters
Page 1 of 1
Fact table structure
I am pretty knew to the matter and need some guidance to the below.
I have been of the view that facts shouldn't contain any descriptive information. But, pretty recently i switched companies and found that we have a scenario where facts in the area had some information like product type, some item codes in addition to item ids, a field called description. I would assume that this would be incorrect modelling. Could some one confirm.
Can facts have record created dates at the end?
I have been of the view that facts shouldn't contain any descriptive information. But, pretty recently i switched companies and found that we have a scenario where facts in the area had some information like product type, some item codes in addition to item ids, a field called description. I would assume that this would be incorrect modelling. Could some one confirm.
Can facts have record created dates at the end?
daredevil- Posts : 9
Join date : 2010-08-05
Re: Fact table structure
If possible please let me know the drawbacks for the same
daredevil- Posts : 9
Join date : 2010-08-05
Re: Fact table structure
Assuming your fact table is capturing events that involve products it would be usual to have the product information such as product type, items codes etc as you mentioned all stored in seperate fields in the product dimension table and the fact table only store the product surrogate key which would point to the appropriate row in said product dimension table
drawbacks would be that incosistant/incomaptible information ie being held in the the same field so you wouldn't be able to report on it in your cube ie you couldn't filter your cube on just products of a certain type if this inforamtion is just being stored in a general description field along with other information.
HTH
drawbacks would be that incosistant/incomaptible information ie being held in the the same field so you wouldn't be able to report on it in your cube ie you couldn't filter your cube on just products of a certain type if this inforamtion is just being stored in a general description field along with other information.
HTH
meb97me- Posts : 34
Join date : 2010-07-28
Re: Fact table structure
In a dimensional design it is, plain and simple, fundimentally wrong.
The purpose of a dimension is to provide context for facts. And of all dimensions, the most critical ones for providing context are the conforming dimensions, and Product is most definiately one of those. If I have multiple fact tables that have product as a dimension, I want to be absolutely sure that every fact table has all the information about that product associated to it. The only way to do that in a dimensional model is to place all attributes about the product in the dimension table.
There is also performance issues. A fact table is usually orders of magnitude larger that a dimension table. You want a fact table that is as thin as possible so queries that process large number of rows can execute efficiently. Bulking up a fact table with descriptions and other attributes just slows the whole thing down.
The purpose of a dimension is to provide context for facts. And of all dimensions, the most critical ones for providing context are the conforming dimensions, and Product is most definiately one of those. If I have multiple fact tables that have product as a dimension, I want to be absolutely sure that every fact table has all the information about that product associated to it. The only way to do that in a dimensional model is to place all attributes about the product in the dimension table.
There is also performance issues. A fact table is usually orders of magnitude larger that a dimension table. You want a fact table that is as thin as possible so queries that process large number of rows can execute efficiently. Bulking up a fact table with descriptions and other attributes just slows the whole thing down.
Re: Fact table structure
Thanks. That helps. We would consider flags such as Y/N as dimensional information too right. Or can such be in facts?
Also, do we have row created dates/timestamps in facts? Thanks again.
Also, do we have row created dates/timestamps in facts? Thanks again.
daredevil- Posts : 9
Join date : 2010-08-05
Re: Fact table structure
Flags, in general, go into dimensions, but there are exceptions... If you are implementing an accumulating snapshot fact table, it is common to include a current flag. However, that flag applies to the fact itself and has nothing to do with a dimension.
As far as insert and update dates go, sure... they go on all the tables. Again, it is because the context of those values relate to the row itself.
The other exeception are degenerate dimensions. These are situations where the entire dimension is the value itself and has no other attributes associated with it. It is commonly used for document numbers, such as order number or check number, where attributes relating to those documents are retained in other dimensions (with FKs off the fact).
As far as insert and update dates go, sure... they go on all the tables. Again, it is because the context of those values relate to the row itself.
The other exeception are degenerate dimensions. These are situations where the entire dimension is the value itself and has no other attributes associated with it. It is commonly used for document numbers, such as order number or check number, where attributes relating to those documents are retained in other dimensions (with FKs off the fact).
Similar topics
» Dear all. I can't figured out how how to linking in my structure the promotion/deal dimensions to the fact table avoiding dupplicates line
» 'Routing' the grain of the fact table to multpile members of multiple dimensions causes the fact table to 'explode'
» Integrating new fact table which has one to many relationship with the main fact table in existing star schema
» How to create fact table with measures derived from comparing two fact table rows
» Healthcare Hospital Stay fact table - transaction fact table - a row for In and a row for Out?
» 'Routing' the grain of the fact table to multpile members of multiple dimensions causes the fact table to 'explode'
» Integrating new fact table which has one to many relationship with the main fact table in existing star schema
» How to create fact table with measures derived from comparing two fact table rows
» Healthcare Hospital Stay fact table - transaction fact table - a row for In and a row for Out?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum