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 ...
随机推荐
- html5人物图片360度立体旋转
体验效果:http://hovertree.com/texiao/html5/10.htm 下载:http://hovertree.com/hvtart/bjae/t16oddyt.htm 代码如下: ...
- Python入门版
一.前言 陆陆续续学习Python已经近半年时间了,感觉到Python的强大之外,也深刻体会到Python的艺术.哲学.曾经的约定,到现在才兑现,其中不乏有很多懈怠,狼狈. Python入门关于Pyt ...
- 在MVC中应用百度富文本编辑器
1.下载.NET版本的百度富文本编辑器,前往 下载.NET版本百度富文本框 2.解压下载的.zip压缩包,将utf8-.net文件夹名称改为:ueditor,复制到MVC根目录下面.结构如下: App ...
- win32程序启用控制台
#include <cstdio> #define USE_WIN32_CONSOLE int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _I ...
- AI - Ideas
Idea: Comprehend code and re-factory code to more readable. The AI program can comprehend source cod ...
- PHP学习笔记:用php读取xml文件
xml已经被json逐渐替代,现在用的api都是用貌似用的json,但是有些老的网站还是在用xml. 这里默认xml文件为:address.xml,存放在和读取的php文件相同级别目录,xml内容如下 ...
- hdu 1518 拼正方形
本题来自:http://acm.hdu.edu.cn/showproblem.php?pid=1518 题意:输入几个长度,判断能否拼成正方形. 以下部分参考了网友代码,终于ac啦. #include ...
- Office版本差别引发的语法问题
由于没有源代码,今天反编译了一个基于.NET的dll类库,再次遇到office版本差异问题,所以把它记录下来. 在反编译时,需要Aspose.Cells 5.3.1(Aspose是一套.NET类库,其 ...
- SharePoint 2013 开启访问请求
1.通常,我们进入SharePoint 2013站点,如果没权限会提示该站点未被共享,而没有切换账号或者申请访问,实在是很流氓:其实,SharePoint为我们提供了访问请求页面,但是可能需要手动开启 ...
- 为什么Android应该根据屏幕分辨率来加载不同的图片文件
1.图片在xxhdpi,手机是hdpi的 我们有一个手机是hdpi的.我们还有一个图片,我们把他放在xxhdpi下.当手机显示的时候,系统会去hdpi中找,发现没有图片,最终在xxhpi中找到.终于找 ...