Currently, I am participating in the design of a new data warehouse. I am quite new to this topic and have a general question regarding Star Schema and Many-to-Many relationships, in particular Many-to-1/2 relationships.
I would like to illustrate my problem with a short example, e.g. a sales data mart. I have a fact table which is on invoice level and contains measures like total sales in $, VAT... For each of these records I have at least one seller and at the maximum two sellers. Both sellers have the same attributes so that only one simple dimension for sellers is needed. How would you model this?
I can imagine the following three different approaches:
- Joining via a Bridge Table - I prefer that one, but I am not sure about this because of the additional effort the bridge table causes through the additional join, especially for large dimensions and especially in a case like this, where a record in the fact table is only associated with one or two records in a dimension table.
- Introducing two seller foreign keys into the fact table - I would use this approach only if there is in general a significant difference between both sellers. E.g. the first seller is always that one who is responsible for a product line (product line seller) and second one is always the key account manager of the customer. One the other side, this approach makes it more difficult to query the data warehouse, for example when I need the total sales of all sellers summed up for the current year regardless their role.
- One record in the fact table per seller - I create a duplicate for the records which have two sellers. Through that approach I can avoid an additional join compared to the bridge table, but my fact table would be larger. In addition, during the creation of a query or report I have to consider and eliminate the duplicates if necessary. So this approach also makes it more difficult to query the data.
Do you have any considerations regarding this? It would be great if you could share some knowledge. Thanks a lot.