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 ...
随机推荐
- 无废话WCF入门教程一[什么是WCF]
http://www.cnblogs.com/iamlilinfeng/archive/2012/09/25/2700049.html wcf技术交流,同学习共进步,欢迎加群: 群号:3981831 ...
- CountDownLatch,CyclicBarrier,Semaphore
CountDownLatch是倒数,doneSignal = new CountDownLatch(LATCH_SIZE);赋初值后,在主线程中等待doneSignal.await();其它线程中,每 ...
- [PHP] 实现路由映射到指定控制器
自定义路由的功能,指定到pathinfo的url上,再次升级之前的脚本 SimpleLoader.php <?php class SimpleLoader{ public static func ...
- C程序(3)
- sublimeCodeIntel 的配置
在项目的根目录目录下建立.codeintel/config 但是在windows 需要进入dos 环境下建立.以点开头的文件夹和文件.资源管理器不允许创建点开头的文件或文件夹,但在命令提示符下是可以的 ...
- C#常用集合的使用(转载)
大多数集合都在System.Collections,System.Collections.Generic两个命名空间.其中System.Collections.Generic专门用于泛型集合. 针对特 ...
- React 初学整理
1,通过createElement创建元素 HELLO Word ps:切记组建名称首字母大写 2,虚拟DOM 在虚拟DOM上操作 通过render来渲染真是DOM 3,JSX JSX 是对JS的语法 ...
- 转:jQuery 常见操作实现方式
http://www.cnblogs.com/guomingfeng/articles/2038707.html 一个优秀的 JavaScript 框架,一篇 jQuery 常用方法及函数的文章留存备 ...
- UIScrollView循环滚动1
现在基本每一个商业APP都会有循环滚动视图,放一些轮播广告之类的,都是放在UIScrollView之上.假如我要实现N张图片的轮播,我借鉴了几个博文,得到两种方法实现: [第一种]:如下图(图片来源于 ...
- AVL树详解
AVL树 参考了:http://www.cppblog.com/cxiaojia/archive/2012/08/20/187776.html 修改了其中的错误,代码实现并亲自验证过. 平衡二叉树(B ...