Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tips and Tricks for Dimensional Modeling By Shawn Jackson.

Similar presentations


Presentation on theme: "Tips and Tricks for Dimensional Modeling By Shawn Jackson."— Presentation transcript:

1 Tips and Tricks for Dimensional Modeling By Shawn Jackson

2 Overview Set of techniques and concepts used in data warehouse design Intended to support end-user queries and is oriented around understandability and performance Uses the concepts of facts (measures) and dimensions (context) Facts are typically (but not always) numerical values that can be aggregated Dimensions are groups of hierarchies and descriptors that define the facts

3 Star Schema

4 Snowflake Schema

5 Kimball University: 10 Essential Rules of Dimensional Modeling (#1-5) 1.Load detailed atomic data into dimensional structures Store data at the lowest grain Use summary tables/views to improve performance as necessary 2.Structure dimensional models around business processes Fact tables should be based on a business event Complement single process fact tables with consolidated fact tables that combine metrics from multiple processes at the same level of detail 3.Ensure that every fact table has an associated date dimension table 4.Ensure that all facts in a single fact table are at the same grain or level of detail 5.Resolve many-to-many relationships in fact tables

6 Kimball University: 10 Essential Rules of Dimensional Modeling (#6-10) 6.Resolve many-to-one relationships in dimension tables 7.Store report labels and filter domain values in dimension tables Dont store codes and descriptions in the fact table Make sure the full description of the code is in the dimension table 8.Make certain that dimension tables use a surrogate key 9.Create conformed dimensions to integrate data across the enterprise Date dimension is a common example Single version of the truth 10.Continuously balance requirements and realities to deliver a DW/BI solution that's accepted by business users and that supports their decision-making

7 Slowly Changing Dimensions Type 0 Type 1 Type 2 Type 3 Type 4 Type 6

8 SCD Type 0 Rows are added but never changed Missing true business / natural key Typically are only used in derived dimensions Type 0 attributes are more common Supplier Key Supplier Name 123Acme Supply Co 124Acme Supply Company

9 SCD Type 1 Rows can be updated or added based upon business key Historical information is not tracked Supplier_KeySupplier_CodeSupplier_NameSupplier_State 123ABCAcme Suply CoCA Supplier_KeySupplier_CodeSupplier_NameSupplier_State 123ABCAcme Supply CoCA Supplier_KeySupplier_CodeSupplier_NameSupplier_State 123ABCAcme Supply CoIL

10 SCD Type 2 Rows are only added A version number or effective dates are used to keep track of history Supplier Key Supplier Code Supplier Name Supplier State Start Date End Date 123ABCAcme Supply CoCA01-Jan Dec ABCAcme Supply CoIL22-Dec-2004

11 SCD Type 3 Rows are updated but not added Historical information is preserved through extra columns Supplier Key Supplier Code Supplier Name Original / Prior Supplier State Effective Date Current Supplier State 123ABCAcme Supply CoCA22-Dec-2004IL

12 SCD Type 4 Combination of type 1 and type 2 dimensions Rows are updated in the type 1 table and added in the type 2 table Supplier Supplier_keySupplier_CodeSupplier_NameSupplier_State 123ABCAcme Supply CoIL Supplier History Supplier HistKey Supplier Key Supplier Code Supplier Name Supplier State Start Date End Date ABC Acme Supply Co CA01-Jan Dec ABC Acme Supply Co IL 22-Dec- 2004

13 SCD Type 6 / hybrid Combines type 1, 2 and 3 in one table Supplier Key Supplier Code Supplier Name Current State Prior State Start Date End Date Current Flag 123ABC Acme Supply Co NYCA 01-Jan Dec N 124ABC Acme Supply Co NYIL 22-Dec Feb N 125ABC Acme Supply Co NY 04-Feb Y

14 Roleplaying Dimensions Recycled for multiple applications within the same database Date dimension is commonly used (sale date, delivery date) Can be used to get different views of data

15 Roleplaying Example

16 Factless Fact Tables Tracking events Many to many joins


Download ppt "Tips and Tricks for Dimensional Modeling By Shawn Jackson."

Similar presentations


Ads by Google