There are few key factors need to be considered to decide on snowflake schema as a data model in DW initiative
If there are hierarchies within the dimension attributes,then keying between Aggregate facts and dimension table(with hierarchies) is not appropriate
A record in sales fact will contain a store key,granularity of the fact table is product by store by day.
Final note is to remember evaluating tradeoffs between ease of use and ease of maintenance with snowflake schema as
normalizing dimensions will involve more joins may result in degrade in query performance
Advantage of snowflake schema
The main advantage of the snowflake schema is the improvement in query performance due to minimized disk storage requirements and joining smaller lookup tables. The main disadvantage of the snowflake schema is the additional maintenance efforts needed due to the increase number of lookup tables.
- Frequency of dimension attribute change
- No of dimension attributes - Large dimensions
- Hierarchies within the dimension attributes
- History tracking of dimension attributes
Consider type 2 SCD implementation is used for history tracking.
If a dimensional table has 10 dimension attributes and only one among the dimension attributes is frequently changing in many rows,
then table becomes huge causing performance issues and unnecesary space consumption by rarely changed dimension attributes.
Move the frequently changed dimension attribute to a seperate table and maintain RI with main dimension table,
Thus snowflaking the dimension to avoid performance issues and unneccesary space consumption
If there are hierarchies within the dimension attributes,then keying between Aggregate facts and dimension table(with hierarchies) is not appropriate
A record in sales fact will contain a store key,granularity of the fact table is product by store by day.
This means the lowest level in geography dimension is store.The hierarchy in the dimension is store, district, region
If we have all hierarchies of geography dimension stored in one table then there is no single key for district or region as the dimension table has only unique key for store
By normalizing the dimensional hierarchies,we can provide single dimension keys(district key ,region key) to aggregate factsFinal note is to remember evaluating tradeoffs between ease of use and ease of maintenance with snowflake schema as
normalizing dimensions will involve more joins may result in degrade in query performance
Advantage of snowflake schema
The main advantage of the snowflake schema is the improvement in query performance due to minimized disk storage requirements and joining smaller lookup tables. The main disadvantage of the snowflake schema is the additional maintenance efforts needed due to the increase number of lookup tables.
Comments
Post a Comment