Friday, August 14, 2015

Degenerated Dimension

Degenerated Dimension: A degenerated dimension is a dimension key in the fact table that does not have it's own table
A Degenerate dimension is a Dimension which is having single attribute. This dimension is represented as a single value in a fact table.
The data items that are not facts and data items that do not fit into the existing dimensions are called as Degenerate Dimensions.
In below example only one key column which is not associated with any other dimension.
the product_no belongs to product dimension and user_id belongs to user dimension but here Invoice_No not belongs to any dimension it can be treated as primary key for fact table

Degenerate Dimensions are fastest way to group similar transactions.Degenerate Dimensions are used when fact tables represent transaction data.
They can be used as primary key for the fact table but they cannot act as foreign keys.
Pros
1. It's avoiding expensive join between two table with a one-many relationship.
2. By degenerating date dimension, we can avoid need of join between event dim and time dimension.
Cons: It will increase fact table size.

No comments: