Slowly Changing Dimensions
Slowly Changing Dimensions
Slowly Changing Dimensions
Presenter:
Miky Schreiber
http://www.miky-schreiber.com
Topics
What we’ll see: We won’t see:
SCD in DWH SCD in OLAP
Why?
Who? When?
How?
Very rarely are the rows in the fact table updated with changes
Also Consider...
How will we adjust the fact table when changes are made?
When?
Good question:
Inside the ETL process
After the ETL process, as a stored procedure
Never (wait, you’ll see…)
Also Consider…
Do we have to use the same type for the entire DWH?
For the same dimension?
Also Consider…
What will happen when number of children is changed?
Also Consider…
What will happen when only the last value before the change is needed?
Also Consider…
Which indexes will help here?
How the “change box” will appear in the real world?
Also Consider…
Must we track changes for all the attributes?
For which attributes will we track changes? What are the considerations?
Also Consider…
What is the data type of the effective date column? Must it contain both date and time?
How will the surrogate key be built?
Advantages? Disadvantages?
Before After
Salesperson Key: 12345 12345
Salesperson Name: Boris Kavkaz Boris Kavkaz
Old Territory Name: (null) Ra’anana
Current Territory Name: Ra’anana Netanya
Effective Date: 1/1/1998 12/1/2000
Also Consider…
What is the effective date before the change?
Can the old terriroty column contain null? What about the current territory?