Types of Dimension Tables in a Data
Warehouse
-
1
Ch Anwar ul Hassan (Lecturer)
Department of Computer Science and Software Engineering
Capital University of Sciences & Technology, Islamabad
Pakistan
anwarchaudary@gmail.com
Intro to Data Warehousing
 A dimension is something that qualifies the quantity
or measures.
 Dimension table contains the data about the
business. The primary keys of the dimension tables
are used in Fact tables with Foreign key
relationship. And the remaining columns in the
dimension is normal data which is the information
about the Objects related to the business.
What is Dimension?
 A Dimension table is a table in a star schema of a
data warehouse.
 Data warehouses are built using dimensional data
models which consist of fact and dimension tables.
 Dimension tables are used to describe dimensions. They
contain dimension keys, values and attributes.
Dimension Table
Commonly used dimension tables in data
warehouse
 Slowly Changing Dimensions
 Rapidly Changing Dimensions
 Junk Dimensions
 Inferred Dimensions
 Conformed Dimensions
 Degenerate Dimensions
 Role Playing Dimensions
 Shrunken Dimensions
 Static Dimensions
Types of Dimensions
 Dimensions that change very slowly overtime
rather than according to regular schedule.
Attributes like name, address can change but not too
often.
 Below are some popular approaches of
SCDs:
 Type 0: This is Passive method. The records
which were inserted will not change any time.
Slowly Changing Dimensions
 Type 1: This method overwrites the old record with
new values without tracking any historical data.
 The advantage of type 1 is that it is very easy to follow and it
results in huge space savings and hence cost savings.
 The disadvantage is that no history is maintained.
Slowly Changing Dimensions
 Type 2: This methods tracks the historical data by
using version number or by using startdate,
enddate columns. The drawback is the table will
grow vertically. And it requires more space.
Slowly Changing Dimensions
 Type 3: This method will also track the historical
data by inserting the column with new value. It
preserves limited history.
 Type 4: This method uses a separate table for
storing all the historical data and main table will
hold the current_data. And both will pointed with
the same surrogate key.
Slowly Changing Dimensions
 Type 3: This method will also track the historical
data by inserting the column with new value. It
preserves limited history.
 Type 4: This method uses a separate table for
storing all the historical data and main table will
hold the current_data. And both will pointed with
the same surrogate key.
Slowly Changing Dimensions
 The Dimension which contains rapidly changing attributes.
If we maintain any historical data for these type of tables.
We will definitely get an issue related to memory and
performance.
 The solution is to maintain mini dimension tables for
historical data like type 4 Dimension in SCD. The main
table should contain the current values and mini
dimensions can contains historical data.
Rapidly Changing Dimensions
Junk Dimension
A junk dimension is a single table with a combination of
different and unrelated attributes to avoid having a
large number of foreign keys in the fact table. They are
often created to manage the foreign keys created by
rapidly changing dimensions.
As per above, if we consider
Gender_Marital_Status we
can use only 1 single column
in Fact table.
Inferred Dimensions: The Dimension which is important to
create a fact table but it is not yet ready, then we can
assign some dummy details for one ID and we can use that
ID in fact table. After getting the details then we can update
the details in the dimension.
Inferred Dimensions
 Conformed Dimensions: Dimensions which are
connected with multiple fact tables are know as
conformed Dimension.
 Eg: Customer Dimension and Product Dimension are
required in Shipment Fact, Sales fact and Service
Request Fact
Conformed Dimension
 Conformed Dimensions: Dimensions which are
connected with multiple fact tables are know as
conformed Dimension.
 Eg: Product, Date and Store Dimension Table are
connected with both Sales and Inventory fact tables.
Conformed Dimension
Degenerate Dimensions: A degenerate table does not
have its own dimension table. It is derived from a fact table.
The column (dimension) which is a part of fact table but
does not map to any dimension.
Eg: SalesOrderNumber in Fact table
Degenerate Dimension
 Role Playing Dimensions: The same dimension
which can be used for multiple purpose
 Eg: Date Dimension can be used as Order day, Ship
day, Close Day etc.
Role play dimension
Shrunken Dimensions: A shrunken dimension is a subset
of another dimension.
Shrunken Dimensions
Static dimensions are not extracted from the
original data source, but are created within the
context of the data warehouse. A static dimension
can be loaded manually — for example with status
codes — or it can be generated by a procedure,
such as a date or time dimension.
Static Dimensions

Intro to Data warehousing lecture 13

  • 1.
    Types of DimensionTables in a Data Warehouse - 1 Ch Anwar ul Hassan (Lecturer) Department of Computer Science and Software Engineering Capital University of Sciences & Technology, Islamabad Pakistan anwarchaudary@gmail.com Intro to Data Warehousing
  • 2.
     A dimensionis something that qualifies the quantity or measures.  Dimension table contains the data about the business. The primary keys of the dimension tables are used in Fact tables with Foreign key relationship. And the remaining columns in the dimension is normal data which is the information about the Objects related to the business. What is Dimension?
  • 3.
     A Dimensiontable is a table in a star schema of a data warehouse.  Data warehouses are built using dimensional data models which consist of fact and dimension tables.  Dimension tables are used to describe dimensions. They contain dimension keys, values and attributes. Dimension Table
  • 4.
    Commonly used dimensiontables in data warehouse  Slowly Changing Dimensions  Rapidly Changing Dimensions  Junk Dimensions  Inferred Dimensions  Conformed Dimensions  Degenerate Dimensions  Role Playing Dimensions  Shrunken Dimensions  Static Dimensions Types of Dimensions
  • 5.
     Dimensions thatchange very slowly overtime rather than according to regular schedule. Attributes like name, address can change but not too often.  Below are some popular approaches of SCDs:  Type 0: This is Passive method. The records which were inserted will not change any time. Slowly Changing Dimensions
  • 6.
     Type 1:This method overwrites the old record with new values without tracking any historical data.  The advantage of type 1 is that it is very easy to follow and it results in huge space savings and hence cost savings.  The disadvantage is that no history is maintained. Slowly Changing Dimensions
  • 7.
     Type 2:This methods tracks the historical data by using version number or by using startdate, enddate columns. The drawback is the table will grow vertically. And it requires more space. Slowly Changing Dimensions
  • 8.
     Type 3:This method will also track the historical data by inserting the column with new value. It preserves limited history.  Type 4: This method uses a separate table for storing all the historical data and main table will hold the current_data. And both will pointed with the same surrogate key. Slowly Changing Dimensions
  • 9.
     Type 3:This method will also track the historical data by inserting the column with new value. It preserves limited history.  Type 4: This method uses a separate table for storing all the historical data and main table will hold the current_data. And both will pointed with the same surrogate key. Slowly Changing Dimensions
  • 10.
     The Dimensionwhich contains rapidly changing attributes. If we maintain any historical data for these type of tables. We will definitely get an issue related to memory and performance.  The solution is to maintain mini dimension tables for historical data like type 4 Dimension in SCD. The main table should contain the current values and mini dimensions can contains historical data. Rapidly Changing Dimensions
  • 11.
    Junk Dimension A junkdimension is a single table with a combination of different and unrelated attributes to avoid having a large number of foreign keys in the fact table. They are often created to manage the foreign keys created by rapidly changing dimensions. As per above, if we consider Gender_Marital_Status we can use only 1 single column in Fact table.
  • 12.
    Inferred Dimensions: TheDimension which is important to create a fact table but it is not yet ready, then we can assign some dummy details for one ID and we can use that ID in fact table. After getting the details then we can update the details in the dimension. Inferred Dimensions
  • 13.
     Conformed Dimensions:Dimensions which are connected with multiple fact tables are know as conformed Dimension.  Eg: Customer Dimension and Product Dimension are required in Shipment Fact, Sales fact and Service Request Fact Conformed Dimension
  • 14.
     Conformed Dimensions:Dimensions which are connected with multiple fact tables are know as conformed Dimension.  Eg: Product, Date and Store Dimension Table are connected with both Sales and Inventory fact tables. Conformed Dimension
  • 15.
    Degenerate Dimensions: Adegenerate table does not have its own dimension table. It is derived from a fact table. The column (dimension) which is a part of fact table but does not map to any dimension. Eg: SalesOrderNumber in Fact table Degenerate Dimension
  • 16.
     Role PlayingDimensions: The same dimension which can be used for multiple purpose  Eg: Date Dimension can be used as Order day, Ship day, Close Day etc. Role play dimension
  • 17.
    Shrunken Dimensions: Ashrunken dimension is a subset of another dimension. Shrunken Dimensions
  • 18.
    Static dimensions arenot extracted from the original data source, but are created within the context of the data warehouse. A static dimension can be loaded manually — for example with status codes — or it can be generated by a procedure, such as a date or time dimension. Static Dimensions