Snowflake weakness and type2 fact table
|
DimProduct |
DimSubcategory |
Dimcategory |
||
|
productpk |
subcategorypk |
categorypk |
||
|
sku |
subcategoryName |
categoryName |
||
|
productName |
categorypk |
|||
|
subcategorypk |
Snow flake schema has one weakness,
Take the product dimension sample, its has subcategory attribute. If we want to track the subcategory's change,
Set the subcategory as a type2 dimension. Now the design can not support.
But how can we fix this issue?
set the product dimension as type2, and change the subcategory and category information all in this product table.
Then the snow flake schema turn into a star schema.
This sample is special, because you can see that the subcategory and category has just one attribute in tables,
If one table 's sub table has more attributes, it is not useful to add all attributes in the parent table.
So what we can do for this case if we want to keep track the sub tables changes?
In this case , we should add the unique key columns and sub table primary key in the parent table.
If your dimension and fact tables are all type2, the customer want to track all the dimension tables' change,
In you fact table, you capture all the relationships for the dimension tables.
If you just populate dimension tables' primary key in the fact table, how could you keep the records consecutive?
You need join back the dimension table and judge whether it change or not?
Or you should add one dimension table's unique key columns in the fact table?
Tell me if you have better solution for this.
Snowflake weakness and type2 fact table的更多相关文章
- SharePoint 部件通过EditorPart自定义属性面板
需求:编写一个新闻展示的WebPart,要求可以分类,类别是从WebService中获取的字符串,要求可以在属性中勾选分类,显示该分类的信息,分类可能会增加.我要做的就是动态生成属性中的新闻类别,至于 ...
- 在Qt中使用SQLite数据库
前言 SQLite(sql)是一款开源轻量级的数据库软件,不需要server,可以集成在其他软件中,非常适合嵌入式系统. Qt5以上版本可以直接使用SQLite(Qt自带驱动). 用法 1 准备 引入 ...
- winfrom 操作Excel
利用Aspose.Cells.dll 操作Excel,内容如下: 1.界面设计: 2.逻辑: using System; using System.Collections.Generic; using ...
- SQL语句中,如何使用含有if....else...判断语句
在我们开发中,有时要对数据库中的数据按照条件进行查询,用到if else类似的语句进行判断,那么if else语句只有在存储过程,触发器之类的才有,但是要在sql上当满足某种条件上要取不同的字段值,刚 ...
- lua weak table 概念解析
lua weak table 经常看到lua表中有 weak table的用法, 例如: weak_table = setmetatable({}, {__mode="v"}) 官 ...
- Table Properties [AX 2012]
Table Properties [AX 2012] 1 out of 2 rated this helpful - Rate this topic Updated: July 20, 2012 Ap ...
- DDL中drop-alter table
一.DROP TABLE语句:用于删除数据表 DROP TABLE removes one or more tables. You must have the DROP privilege for e ...
- oracle temporary table
oralce 有两种临时表 a.会话级临时表 b.事物级临时表 A.事物级临时表 语法 create global temporary table table_name( col1 type1, ...
- snowflake 分布式唯一ID生成器
本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn 摘要: 原文参考运维生存和开源中国上的代码整理 我的环境是pytho ...
随机推荐
- bootstrap学习笔记(6)
滚动监听 滚动监听有两种方式: (1)通过属性控制 向想要滚动监听的元素添加如下属性data-spy="scroll",然后添加data- ...
- Debian GNU/kFreeBSD是什么
Debian GNU/kFreeBSD 是由使用GNU C语言库的GNU成员组成的基于FreeBSD内核.外加完整的Debian 软件包集合的操作系统. 它来自Debian社区,所以本质上,我们还是应 ...
- .NET Core添加项目之间的依赖关系
- [Tool] 使用Astah绘制UML图形
[Tool] 使用Astah绘制UML图形 前言 在软件开发的过程中,开发人员可以绘制UML图形来将分析设计内容转化为图形化文件,方便在团队之间传递分析设计结果.但在团队经费有限的情景中,可能没办法为 ...
- 基于流的自动化构建工具------gulp (简单配置)
项目上线也有一阵子,回头过来看了看从最初的项目配置到开发的过程,总有些感慨,疲软期,正好花点时间,看看最初的配置情况 随着前端的发展,前端工程化慢慢成为业内的主流方式,项目开发的各种构建工具,也出现了 ...
- Microsoft Dynamics 2013 --Social Pane
Microsoft Dynamics 2013 有一个新的东西--Social Pane (图1) 进入窗体设置,发现改选项卡的详细设置如下 (图2) Tab键的选项有3种[活动][公告][注释],若 ...
- [leetcode] Contains Duplicate
Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your funct ...
- App开发流程之图像处理工具类
先罗列一下工具类中提供的方法: /** * 根据原始view和毛玻璃样式,获取模糊视图,并自动作为原view的subview(如果不需要作为子视图,自行调用removeFromSuperview) * ...
- 朝花夕拾-android 自定义application 管理activity的生命周期
为了安全退出多个已创建的activity? 可以自定义application:myapplication. 增加一个list成员保存,一些关键的已创建的activity实例: private List ...
- 在virtualbox下使用vm映像文件
virtualbox可以直接打开vmdk 创建虚拟机时先不要创建虚拟硬盘. 虚拟机创建成功后,在设置窗口,点击[存储],添加虚拟硬盘,点击选择现有的虚拟盘. 参考链接