Reputation: 9714
I have a sales fact table. Each row represents a sale.
The columns are sale_id, product_name, product_category, sale_date, sale_amount.
I want to understand what benefit would it provide to extract the product values (product_name, product_category) into a dimension table?
I understand it will save some space by having the dimension table and just product_id in sales fact table (But given the column compression, storage is not much of an issue). What else is the use of having a separate dimension table?
Upvotes: 1
Views: 322
Reputation: 555
Assuming low carnality (e.g. 1billion sales, less than 3k products) Filtering desired products first and then joining via surrogate key is more efficient than filtering directly on the fact table.
It is also easy to include new attributes on the product dimension without having an impact on the sales fact table.
Upvotes: 1
Reputation: 5525
Storage is one, another one could be the need to add another fact table with product related facts down the road (production, purchases, returns, complaints, you name it).
Upvotes: 0