<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA["lynx286原创--缓慢变化维解决方案" 主题的最后发表文章]]></title>
		<link>http://www.mydwbi.com/posts/list/13.page</link>
		<description><![CDATA[最后发表在 "lynx286原创--缓慢变化维解决方案" 主题的信息]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ Lynx286原创<br /> [url]www.mydwbi.com[/url]版权所有<br /> 欢迎转贴，转贴请注明出处。<br /> 如文本格式阅读不方便，请下载word版本。<br /> <br /> <br /> 2008-5-23<br />  <br /> 目录<br /> <br /> 缓慢变化维解决方案	1<br /> 参考文档：Wikipedia	2<br /> 一.新数据覆盖旧数据	3<br /> 二.保存多条记录，并添加字段加以区分	3<br /> 三.不同字段保存不同值	4<br /> 四．另外建表保存历史记录	4<br /> 五．混合模式	5<br /> 六．非常规混合模式	6<br /> <br /> <br /> <br /> <br /> 参考文档：Wikipedia <br /> <br /> 缓慢变化维定义<br /> <br /> Wikipedia中的定义：<br /> Dimension is a term in data management and data warehousing that refers to logical groupings of data such as geographical location, customer information, or product information.<br /> <br /> Slowly Changing Dimensions (SCD) are dimensions that have data that slowly changes.<br /> <br /> 大意是说数据会发生缓慢变化的维度就叫”缓慢变化维”。<br /> 举个例子就清楚了：<br /> 在一个零售业数据仓库中，事实表保存着各销售人员的销售记录，某天一个销售人员从北京分公司调到上海分公司了，那么如何来保存这个变化呢？也就是说销售人员维度要怎么恰当的处理这一变化。先来回答一个问题，为什么要处理，或保存这一变化？如果我们要统计北京地区或上海地区的总销售情况的时候，这个销售人员的销售记录应该算在北京还是算在上海？当然是调离前的算在北京，调离后的算在上海,但是如标记这个销售人员所属区域？这里就需要处理一下这个维度的数据，即我们缓慢变化维需要做的事情。<br /> <br /> 处理缓慢变化维一般按不同情况有以下几种解决方案：<br /> <br /> 一.	新数据覆盖旧数据<br /> 此方法必须有前提条件，即你不关心这个数剧的变化。例如，某个销售人员的英文名改了，如果你不关心员工的英文名有什么变化则可直接覆盖(修改)数据仓库中的数据。<br /> <br /> 二.	保存多条记录，并添加字段加以区分<br /> 这种情况下直接新添一条记录，同时保留原有记录，并用单独的专用的字段保存区别。如：<br /> (以下表格中Supplier_State表示上面例子中所属区域，为描述清晰，不用代理键表示)<br /> <br /> Supplier_key	Supplier_Code	Supplier_Name	Supplier_State	Disable<br /> 001	ABC	Phlogistical Supply Company	CA	Y<br /> 002	ABC	Phlogistical Supply Company	IL	N<br /> 或：<br /> <br /> Supplier_key	Supplier_Code	Supplier_Name	Supplier_State	Version<br /> 001	ABC	Phlogistical Supply Company	CA	0<br /> 002	ABC	Phlogistical Supply Company	IL	1<br /> <br /> 以上两种是添加数据版本信息或是否可用来标识新旧数据。<br /> 下面一种则是添加记录的生效日期和失效日期来标识新旧数据：<br /> <br /> Supplier_key	Supplier_Code	Supplier_Name	Supplier_State	Start_Date	End_Date<br /> 001	ABC	Phlogistical Supply Company	CA	01-Jan-2000	21-Dec-2004<br /> 002	ABC	Phlogistical Supply Company	IL	22-Dec-2004	<br /> <br /> 空的End_Date表示当前版本数据，或者你也可一用一个默认的大时间 (如: 12/31/9999)来代替空值, 这样数据还能被索引识别到.<br /> <br /> 三.	不同字段保存不同值<br /> <br /> Supplier_key	Supplier_Name	Original_Supplier_State	Effective_Date	Current_Supplier_State<br /> 001	Phlogistical Supply Company	CA	22-Dec-2004	IL<br /> <br /> 这种方法用不同的字段保存变化痕迹.但是这种方法不能象第二种方法一样保存所有变化记录,它只能保存两次变化记录.适用于变化不超过两次的维度。<br /> <br /> 四.	另外建表保存历史记录<br /> <br /> 即另外建一个历史表来表存变化的历史记录，而维度只保存当前数据。<br /> <br /> Supplier:<br /> Supplier_key	Supplier_Name	Supplier_State<br /> 001	Phlogistical Supply Company	IL<br /> <br /> Supplier_History:<br /> Supplier_key	Supplier_Name	Supplier_State	Create_Date<br /> 001	Phlogistical Supply Company	CA	22-Dec-2004<br /> <br /> 这种方法仅仅记录一下变化历史痕迹，其实做起统计运算来还是不方便的。<br /> <br /> 五.	混合模式<br /> 这种模式是以上几种模式的混合体，相对而言此种方法更全面，更能应对错综复杂且易变化的用户需求，也是较为常用的。<br /> <br /> Row_Key	Supplier_key	Supplier_Code	Supplier_Name	Supplier_State	Start_Date	End_Date	Current Indicator<br /> 1	001	ABC001	Phlogistical Supply Company	CA	22-Dec-2004	15-Jan-2007	N<br /> 2	001	ABC001	Phlogistical Supply Company	IL	15-Jan-2007	1-Jan-2099	Y<br /> <br /> <br /> 此中方法有以下几条优点：<br /> 1.	能用简单的过滤条件选出维度当前的值。<br /> 2.	能较容易的关联出历史任意一时刻事实数据的值。<br /> 3.	如果事实表中有一些时间字段(如：Order Date, Shipping Date, Confirmation Date)，那么我们很容易选择哪一条维度数据进行关联分析。<br /> <br /> 其中Row_Key和 Current Indicator字段是可有可无的，加上去更方便，毕竟维度表的数据都不大，多点冗余字段不占太大空间但能提高查询效率。<br /> 这种设计模式下事实表应以Supplier_key为外键，虽然这个字段不能唯一标识一条维度数据，从而形成了事实表与维表多对多的关系，因此在做事实和维度做关联时应加上时间戳字段(或Indicator字段)。<br /> <br /> 六.	非常规混合模式<br /> 上面说到第五种实现方式有点弊端，那就是事实表和维表不是多对一关系，而是多对多关系，这种关系不能在建模时解决只能在报表层面，在报表运行时解决，且在BI语意层建模时需要添加时间过滤条件，比较繁琐。<br /> 下面这种解决方案可以解决此多对多关系，但是得修改一下事实表：<br /> <br /> Supplier Dimension:<br /> Version_Number	Supplier_key	Supplier_Code	Supplier_Name	Supplier_State	Start_Date	End_Date<br /> 1	001	ABC001	Phlogistical Supply Company	CA	22-Dec-2004	15-Jan-2007<br /> 0	001	ABC001	Phlogistical Supply Company	IL	15-Jan-2007	1-Jan-2099<br /> <br /> Fact Delivery: (为描述清晰，同样不使用代理键标识维度)<br /> Delivery_Key	Supplier_key	Supplier_version_number	Quantity	Product	Delivery_Date	Order_Date<br /> 1	001	0	132	Bags	22-Dec-2006	15-Oct-2006<br /> 2	001	0	324	Chairs	15-Jan-2007	1-Jan-2007<br /> <br /> 此方案中向维表中的当前数据版本号始终为0，即插入维度数据时先将老版本的数据的version_number改成1（递增），然后再插入当前数据，此时才能保持当前数据版本号始终为0。<br /> 事实表中插入数据时所有的维度数据版本号始终全部为0。<br /> 因此此方案完全可解决事实表和维表多对多关系问题，另外还有个优点是能保证事实表和维表的参照完整性，而且我们在用ERwin,PowerDesigner等建模工具建模时，Version_Number和Supplier_key可作为复合主键在两实体间建立链接。<br /> <br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/675.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/675.page</link>
				<pubDate><![CDATA[Fri, 23 May 2008 10:04:54]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[         個人認為 方法二比較適中，加上生效和失效日期便于識別]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/676.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/676.page</link>
				<pubDate><![CDATA[Fri, 23 May 2008 19:56:25]]> GMT</pubDate>
				<author><![CDATA[ Ken]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 很好的资料,谢谢楼主!]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/757.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/757.page</link>
				<pubDate><![CDATA[Wed, 28 May 2008 03:49:34]]> GMT</pubDate>
				<author><![CDATA[ seabluezx]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 六. 非常规混合模式 <br /> 这个方式 <br /> 如果想看历史数据的统计 怎么实现 不是很明白<br /> 和我理解的不一样]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/776.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/776.page</link>
				<pubDate><![CDATA[Wed, 28 May 2008 23:51:31]]> GMT</pubDate>
				<author><![CDATA[ zdcku]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 第六种，事实表和维表用<br /> Fact_Delivery.Supplier_key = Supplier_Dimension.Supplier_key and <br /> Fact_Delivery.Version_Number = Supplier_Dimension.Version_Number <br /> 关联就行了，其他条件如Delivery_Date between xxx and yyy 限制你说说得历史时间段，<br /> 然后加些group by 就行了。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/777.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/777.page</link>
				<pubDate><![CDATA[Thu, 29 May 2008 00:56:51]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 那这个"事实表中插入数据时所有的维度数据版本号始终全部为"无必要吧<br /> 既然全部为0 就可以不存这个字段了吧]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/794.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/794.page</link>
				<pubDate><![CDATA[Thu, 29 May 2008 20:12:24]]> GMT</pubDate>
				<author><![CDATA[ zdcku]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ Supplier Dimension: <br /> Version_Number Supplier_key Supplier_Code   ISNEW_FLAG Supplier_Name Supplier_State        Start_Date    End_Date <br /> [color=red]1 [/color]                    001             N              ABC001          Phlogistical     Supply Company CA 22-Dec-2004 15-Jan-2007 <br /> [color=red]2 [/color]                    001             Y             ABC001          Phlogistical     Supply Company IL  15-Jan-2007  1-Jan-2099 <br /> Version_Number新的记录来就自加1<br /> Fact Delivery: (为描述清晰，同样不使用代理键标识维度) <br /> Delivery_Key Supplier_key Supplier_version_number Quantity Product Delivery_Date Order_Date <br /> 1                001             [color=red]1 [/color]                               132        Bags    22-Dec-2006 15-Oct-2006 <br /> 2                001             [color=red]2 [/color]                               324        Chairs  15-Jan-2007  1-Jan-2007 <br /> 事实表来新记录始终得到维度表中ISNEW_FLAG 为'Y'的记录 <br /> <br /> 这样可以很直接的关联到 某个事实记录对应的维度属性 不需要时间做BETWEEN <br /> 这样不知道 后来方不方便后面做展现<br /> <br /> 我也是刚接触这个 自己都不是很清晰我自己的是否可行<br /> 感觉这样的话 事实表就不需要两个日期字段了吧 就一个就够了<br /> 还有 你的事实表两个日期字段是基于什么考虑的<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/795.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/795.page</link>
				<pubDate><![CDATA[Thu, 29 May 2008 20:21:14]]> GMT</pubDate>
				<author><![CDATA[ zdcku]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 不存在这个字段那就跟第五种一样了，第六种是在第五种得基础上解决多对多关系，在BI语意层建模时需要添加时间过滤条件，数据仓库模型建模时也不方便等问题得。<br /> <br /> “始终得到维度表中ISNEW_FLAG 为'Y'的记录” 和“维表中的当前数据版本号始终为0”不是一样得效果吗? 数据仓库建模还要考虑报表语义层建模得方便。<br /> <br /> 两个日期字段方便取得某一行记录生效的时间区间，一个时间字段就不好区分了，数据仓库的数据两一般比较大，尽量少做关联（join），多一两个冗余字段关系不大。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/797.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/797.page</link>
				<pubDate><![CDATA[Thu, 29 May 2008 21:01:48]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 晕了 已经<br /> 寒<br /> 疑问的是 Supplier_version_number 这个在事实表的值一直都是0?]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/803.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/803.page</link>
				<pubDate><![CDATA[Fri, 30 May 2008 00:03:32]]> GMT</pubDate>
				<author><![CDATA[ zdcku]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote=zdcku]晕了 已经<br /> 寒<br /> 疑问的是 Supplier_version_number 这个在事实表的值一直都是0?[/quote]<br /> <br /> 是。<br /> 同时保持维表中当前可用得那条记录得version_number 是0]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/804.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/804.page</link>
				<pubDate><![CDATA[Fri, 30 May 2008 00:31:39]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 恩 理解了<br /> ]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/811.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/811.page</link>
				<pubDate><![CDATA[Fri, 30 May 2008 02:02:19]]> GMT</pubDate>
				<author><![CDATA[ zdcku]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 老大，看了你的文章有所启发，不过没我现在的业务复杂<br /> 目前我遇到的情况是机构的合并和拆分问题，即：Supplier_key会有规律的改变，而且原来一条记录可能会变成n条，n条会变成1条。<br /> 不知道这样的情况怎么解决？<br /> 我初步的想法是在你的第6种方案中再加入,super_Supplier_key<br /> 呵呵]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/860.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/860.page</link>
				<pubDate><![CDATA[Thu, 5 Jun 2008 03:36:30]]> GMT</pubDate>
				<author><![CDATA[ yevolx]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote=yevolx]老大，看了你的文章有所启发，不过没我现在的业务复杂<br /> 目前我遇到的情况是机构的合并和拆分问题，即：Supplier_key会有规律的改变，而且原来一条记录可能会变成n条，n条会变成1条。<br /> 不知道这样的情况怎么解决？<br /> 我初步的想法是在你的第6种方案中再加入,super_Supplier_key<br /> 呵呵[/quote]<br /> <br /> 机构的合并和拆分问题确实比较复杂， <img src="http://www.mydwbi.com//images/smilies/620318dbe36cc21c81760827bbab6ec6.gif" border="0"> 希望老兄解决后能将需求和解决方案详细描述一下，与大家分享。 <img src="http://www.mydwbi.com//images/smilies/e192a67e73d6dd88cff182e99cbe3fca.gif" border="0"> <img src="http://www.mydwbi.com//images/smilies/e192a67e73d6dd88cff182e99cbe3fca.gif" border="0">]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/863.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/863.page</link>
				<pubDate><![CDATA[Thu, 5 Jun 2008 04:21:02]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[  <img src="http://www.mydwbi.com//images/smilies/f3148af081bc2c67c8319e334bdb4edb.gif" border="0">还指望老大能给点建议呢！]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/870.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/870.page</link>
				<pubDate><![CDATA[Thu, 5 Jun 2008 20:43:36]]> GMT</pubDate>
				<author><![CDATA[ yevolx]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote=yevolx] <img src="http://www.mydwbi.com//images/smilies/f3148af081bc2c67c8319e334bdb4edb.gif" border="0">还指望老大能给点建议呢！[/quote]<br /> <br />  <img src="http://www.mydwbi.com//images/smilies/c3f9eb592300620b1fded6249630999c.gif" border="0">论坛是大家的论坛，是大家讨论的地方，我一个人在那说有什么意思，留点空间给大家讨论吧，这才是论坛的气氛。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/873.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/873.page</link>
				<pubDate><![CDATA[Fri, 6 Jun 2008 07:12:10]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 总结得很好` <br /> 第五 只比第二 多了个代理键<br /> 第五种方法好~ ]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/914.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/914.page</link>
				<pubDate><![CDATA[Thu, 12 Jun 2008 00:47:13]]> GMT</pubDate>
				<author><![CDATA[ lanxing2210]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote] 其中Row_Key和 Current Indicator字段是可有可无的，加上去更方便，毕竟维度表的数据都不大，多点冗余字段不占太大空间但能提高查询效率。<br /> 这种设计模式下事实表应以Supplier_key为外键，虽然这个字段不能唯一标识一条维度数据，从而形成了事实表与维表多对多的关系，因此在做事实和维度做关联时应加上时间戳字段(或Indicator字段)。 [/quote]<br /> <br /> 在第5 种模式中，row_key有何作用，supplier_key并不能为维表主键，那么事实表又怎么以supplier_key为外键呢？<br /> 应该不加任何主外键约束吧。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/967.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/967.page</link>
				<pubDate><![CDATA[Sun, 15 Jun 2008 23:49:38]]> GMT</pubDate>
				<author><![CDATA[ myoraclejava]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote=myoraclejava][quote] 其中Row_Key和 Current Indicator字段是可有可无的，加上去更方便，毕竟维度表的数据都不大，多点冗余字段不占太大空间但能提高查询效率。<br /> 这种设计模式下事实表应以Supplier_key为外键，虽然这个字段不能唯一标识一条维度数据，从而形成了事实表与维表多对多的关系，因此在做事实和维度做关联时应加上时间戳字段(或Indicator字段)。 [/quote]<br /> <br /> 在第5 种模式中，row_key有何作用，supplier_key并不能为维表主键，那么事实表又怎么以supplier_key为外键呢？<br /> 应该不加任何主外键约束吧。[/quote]<br /> <br /> <br /> [list]row_key仅起行标识符作用，自增序列，或成为代理键，无其他作用，可有可无（文档中有说明的）[/list]<br /> [list]supplier_key在业务逻辑上是主键，但物理存储上不能作为主键，所以事实表与他仅在逻辑上是主外键关系，事实上事实表和此维表是多对多关系，因此这也是第六中方法要解决的问题。他们在物理上并不是主外键关系，而且我们做大项目时往往考虑到主外键关系可能会影响etl插入效率问题，有时候会不建索引和主外键关系，或etl后再重建索引和主外键。<br /> [/list]<br /> <br /> 欢迎大家共同探讨！ <img src="http://www.mydwbi.com//images/smilies/e192a67e73d6dd88cff182e99cbe3fca.gif" border="0"> <img src="http://www.mydwbi.com//images/smilies/e192a67e73d6dd88cff182e99cbe3fca.gif" border="0"> <img src="http://www.mydwbi.com//images/smilies/e192a67e73d6dd88cff182e99cbe3fca.gif" border="0">]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/969.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/969.page</link>
				<pubDate><![CDATA[Mon, 16 Jun 2008 02:28:36]]> GMT</pubDate>
				<author><![CDATA[ lynx286]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[  <img src="http://www.mydwbi.com//images/smilies/4023d1fd08e8de9a16c68de9b838aae3.gif" border="0">   你的回答证实了我的理解是正确的，只是我抠住文字，有点弄糊涂了。<br /> 我觉得，第五种模式较第二种模式，使跟踪维度变化避免了牵涉到业务数据，而只关系到supplier_key。<br /> 第六种较第五种，在数据上建立关系，避免在报表层加过滤。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/973.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/973.page</link>
				<pubDate><![CDATA[Mon, 16 Jun 2008 03:28:13]]> GMT</pubDate>
				<author><![CDATA[ myoraclejava]]></author>
			</item>
			<item>
				<title>lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ 纬度变化有两种：<br /> 一种是纬度成员变化（最底层）；一种是纬度层次结构变化（机构的合并、分拆）；<br /> 不管采取那种方案，要清楚客户的最终想要什么。<br /> 根据的客户要求决定采取那种方案。<br /> <br /> 注意：历史是正确的，为什么要改变历史。]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/1476.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/1476.page</link>
				<pubDate><![CDATA[Wed, 23 Jul 2008 00:31:18]]> GMT</pubDate>
				<author><![CDATA[ qiang_fu]]></author>
			</item>
			<item>
				<title>回复:lynx286原创--缓慢变化维解决方案</title>
				<description><![CDATA[ [quote=lynx286]第六种，事实表和维表用<br /> Fact_Delivery.Supplier_key = Supplier_Dimension.Supplier_key and <br /> Fact_Delivery.Version_Number = Supplier_Dimension.Version_Number <br /> 关联就行了，其他条件如Delivery_Date between xxx and yyy 限制你说说得历史时间段，<br /> 然后加些group by 就行了。[/quote]<br /> <br /> 按照楼主的说法:<br /> 我们其实在刷新事实表的时候首先需要解决一个问题即把维表的Version_Number刷新进入事实表中.<br /> <br /> 如果要这样做的话,我们完全可以加上一个字段,dim_sequence,维表中所有维值会初始化为不同的sequence值,若其中维值发生变化,则sequence自动递增1,即整个维表以dim_sequence为主键,在刷新时将当前维值的dim_sequence放进事实表中,以后需要展现时,通过dim_sequence关联即可.<br /> 当然,维表的每一条记录还是要保留其生命周期的,即start_date,end_date 能更方便地查得更多的信息.<br /> <br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.mydwbi.com/posts/preList/144/1495.page</guid>
				<link>http://www.mydwbi.com/posts/preList/144/1495.page</link>
				<pubDate><![CDATA[Thu, 24 Jul 2008 04:43:36]]> GMT</pubDate>
				<author><![CDATA[ flysky0814]]></author>
			</item>
	</channel>
</rss>