In a star schema, are foreign key constraints between facts and dimensions neccessary?

前端 未结 7 2024
清酒与你
清酒与你 2021-01-02 19:33

I\'m getting my first exposure to data warehousing, and I’m wondering is it necessary to have foreign key constraints between facts and dimensions. Are there any major downs

7条回答
  •  失恋的感觉
    2021-01-02 19:38

    I think in theory, you need that. But it depends on how you separate your data over database. If all of them in the same database, foreign key can help you because setting foreign key will help the database do selecting faster based on the indexing. If you share tables over many database, you need to check it on your application level

    You can have your database check it for you but it can be slow. And generally, in data warehouse, we don't care about redundancy or integrity. We already have a lot of data and a few integrity and redundancy will not affect the general aggregate data

提交回复
热议问题