Alias tables are an important part of designing a Physical layer because they enable you to reuse an existing table more than once.
An alias table is a physical table that references a different physical table as its source (called the original table).
There are several versions of advantages of Alias tables .Below are some noted points.
- Avoid circular joins.
- Reuse the same object more than once.
- Same table can act both as dimension and fact using aliases..
Example 1:
Consider we have a two dates in a fact (Order_date and Ship_Date) and its has to be joined to Time dimension on both the keys.Since we cannot join both dates to a single key we create an Alias to Time dimension and join the Fact with two time dimensions one with Order_Date and the other with Sales_Order
Example 2:
Lets say we have a table Sales with following columns.
Order_Number,Item,Order_date,customer,Order_Qty
Since the same table is having dimensions and facts,we take an alias Sales_Fact & Sales_Dim and join on Order_Number.
No comments:
Post a Comment