Type 4: Mini-Dimension
解决维度中的某些属性变化频繁的问题,例如Cusotmer中的年龄,收入,购买频率等属性。
优点:1)节省存储空间;
2)不需要频繁的对维度的属性进行更改。
实例:(摘自Kimball的书)
Note:
在插入Fact表的时候需要决定Customer的Demographics Key是多少?
随着年龄或者收入的变化造成同一个CustomerKey对应多个DemographicsKey。此时通过收入来查询时获取的都是Customer在此收入下的行为.
Type 5: Mini-Dimension and Type 1 Outrigger
在Type 4的基础上在CustomerDimension上添加了当前的Demographics.
主要同Type 4进行区别:如果收入->Current Dempgraphics Key->Fact 的话则此行为可能包含了Customer的历史信息。因为在Fact表中Customer可能对应多个Dempgraphics Key.
Type 6: (Hybrid)
与Type 4 或者Type 5最主要的区别是Hybrid的可以获取历史信息。这里的Current Department Name类似于Type 5的Current Demogrphics key。所不同的是Type 6可以通过Historic Department Name获取历史信息。
在实际应用中最重要的是理解你的业务逻辑,最终确定你要什么从而来选择合适的维度设计.
With this hybrid approach, you issue a new row to capture the change (type 2)
and add a new column to track the current assignment (type 3), where subsequent
changes are handled as a type 1 response.
Type7: Dual Type 1 and Type 2 Dimensions
示例: