简体   繁体   English

数据仓库事实星座模式

[英]Data Warehouse Fact Constellation schema

I have two fact tables one depend on date date dimension (Day,month,year).我有两个事实表,一个取决于日期日期维度(日、月、年)。 and the other depend on month and year only.另一个仅取决于月份和年份。 So my question do i need to create two dimension one has (day month year) and another dimension that only has year and month?所以我的问题是我是否需要创建两个维度,一个有(日月年)和另一个只有年月的维度?

Thank you.谢谢你。

A touch late here;有点晚了; sorry about that.对于那个很抱歉。 Yes, you should build two dimension tables.是的,您应该构建两个维度表。 I'd also recommend a relationship between them (ie each month has multiple days).我还推荐它们之间的关系(即每个月都有多天)。 Finally, and some consider this controversial, you might want to do more of a snowflake approach here and have the day level tables contain no information about months (eg month name, month number, etc.) beyond a link to the month table.最后,有些人认为这是有争议的,您可能希望在这里做更多的雪花方法,并且让日级别表不包含有关月份的信息(例如月份名称、月份编号等),除了指向月份表的链接。 The downside is that you'll almost always have to join the month table to the day table when you use the day table.不利的一面是,当您使用日表时,您几乎总是必须将月表连接到日表。 Some feel this join is cheap and worth it for the benefit in reduced data redundancy.一些人认为这种连接很便宜,而且值得减少数据冗余。 Others feel that any unnecessary join in a star is to be avoided.其他人则认为应避免任何不必要的加入明星。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM