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 ...
随机推荐
- Mantis 缺陷管理系统配置与安装
什么是Mantis MantisBT is a free popular web-based bugtracking system (feature list). It is written in t ...
- sns社区架构设计案例分享(二)
源码下载地址:http://www.jinhusns.com/Products/Download/?type=xcj 五. 架构使用说明 > 缓存 > 使用说明 > (一)基础类库介 ...
- 【Java Saves!】Session 6:十六指星人
前面说,计算机用2个手指头数数,它内部的数是二进制,有0和1两个数字.也看到,对于人来说,二进制数too long, too inconvenient, sometimes troublesome.程 ...
- UGUI之Toggle使用
Toggle对象是一个开关.一般用于单选,可以用Toggle制作背包的选项卡 在场景中创建Toggle按钮.看看他有Toggle组件
- linux下mysql忘记root密码解决方法
如果使用 MySQL 数据库忘记了root账号密码,可以通过调节配置文件,跳过密码的方式登数据库, 在数据库里面修改账号密码,一般默认的账号是 root 1.编辑 MySQL 配置文件 my.cnf ...
- Java中的GOF23(23中设计模式)--------- 工厂模式(Factory)
Java中的GOF23(23中设计模式)--------- 工厂模式(Factory) 在给大家介绍工厂模式之前,我想和大家聊聊面向对象的那点事,在这里,引入三个概念. 开闭原则(Open Close ...
- [js开源组件开发]js手机端浮层控件,并有多种弹出小提示,兼容pc端浏览器
js dialog组件,包含alert和confirm的实现 本组件所有的资源均在github上可以查看源代码 GitHub 本dialog的组件的例子请在这里查看 demo dialog js di ...
- js一些小题(二)
******************************************************************* 一个全局下的函数: function test() { aler ...
- andriod 资源文件之存取操作
来自:http://blog.csdn.net/jianghuiquan/article/details/8569235 <?xml version="1.0" encodi ...
- Snort - manual 笔记(二)
1.5 Packet Acquisition Snort 2.9 引入 DAQ 代替直接调用 libpcap . 有两种网卡特性会影响 Snort : "Large Receive Offl ...