Thursday, December 31, 2009

数据仓库建模_8

Common Matrix Mishaps
Departmental or overly encompassing rows.
Report-centric or too narrowly defined rows.
Overly generalized columns.
Separate columns for each level of a hierarchy.
Slowly Changing Dimensions
Type 1: Overwrite the Dimension Attribute 
         the original dimension, only the latest infor is saved.
Type 2: Add a New Dimension Row
         the time period attribute is added.
Type 3: Add a New Dimension Attribute
         add a version to attribute, user can choose any version of dimension. very useful when user want to switch the dimension.
Mini-Dimensions: Add a New Dimension
         break a huge dimension into stable parts and frequently changing parts.
Hybrid Slowly Changing Dimension Techniques
        try to adopt the advantage of above basic kinds of dimensions. Be care when use it.
Role-Playing Dimensions
        A single dimension used many place of a model could be addressed as 'Role-Playing Dimensions'
Junk Dimensions
        When the dimension cannot deal with legacy flag or text attribute. Try these
        Leave them in the fact table.
           but it's worst practice.
        Make them into separate dimensions.
           it may lead to the exploring of dimensions. RimBall says "we strive to have fewer than twenty foreign keys in a fact table for most industries and business processes. "
        Eliminate them. 
            if it's meaningless, yield them.
Note Junk dimension is a highly technical term; try use some neuter like "invoice indicator".
Snowflaking and Outriggers
        A snowflaking dimension is normalized dimension. seperated and then linked back .
        An outrigger is useful if most of the dimension records share handful common informations.

three types of dimension 
Transaction Fact Tables
Periodic Snapshot Fact Tables
Accumulating Snapshot Fact Tables
Factless Fact Tables

No comments: