Thursday, September 17, 2015

Fact Table VS Dimension Table: Could a table be both?

Fact tables are the large tables in your data warehouse schema that store business measurements. Fact tables typically contain facts and foreign keys to the dimension tables. Fact tables represent data, usually numeric and additive, that can be analyzed and examined. Examples include SalesCost, and Profit.

Dimension tables, also known as lookup or reference tables, contain the relatively static data in the warehouse.Dimension tables are usually textual and descriptive and you can use them as the row headers of the result set. Examples are Customers or Products.

Could a table be both Fact table and Dimension table? The answer is No. Fact table is a core part of Star Schema. The Fact table will associate with multiple Dimension tables, to which a Star Schema formed. Note Fact table data can be aggregated while Dimension table can not be aggregated. Fact table data are not supposed to be updated and Dimension data could be updated sometimes. SSAS even has size limit for dimension table.

Dimension tables can have parent dimension tables, and thus formed Snowflake Schema. However, designers attempt to avoid this kind of design since it causes more joins that slow performance. 

Developer sometimes feel confused for some tables as they looked like both Fact and Dimension table. For example, User with accumulated points, the table would be divided into User part, which is Dimension table, and accumulated points, which is Fact table.

No comments:

Post a Comment