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的更多相关文章

  1. SharePoint 部件通过EditorPart自定义属性面板

    需求:编写一个新闻展示的WebPart,要求可以分类,类别是从WebService中获取的字符串,要求可以在属性中勾选分类,显示该分类的信息,分类可能会增加.我要做的就是动态生成属性中的新闻类别,至于 ...

  2. 在Qt中使用SQLite数据库

    前言 SQLite(sql)是一款开源轻量级的数据库软件,不需要server,可以集成在其他软件中,非常适合嵌入式系统. Qt5以上版本可以直接使用SQLite(Qt自带驱动). 用法 1 准备 引入 ...

  3. winfrom 操作Excel

    利用Aspose.Cells.dll 操作Excel,内容如下: 1.界面设计: 2.逻辑: using System; using System.Collections.Generic; using ...

  4. SQL语句中,如何使用含有if....else...判断语句

    在我们开发中,有时要对数据库中的数据按照条件进行查询,用到if else类似的语句进行判断,那么if else语句只有在存储过程,触发器之类的才有,但是要在sql上当满足某种条件上要取不同的字段值,刚 ...

  5. lua weak table 概念解析

    lua weak table 经常看到lua表中有 weak table的用法, 例如: weak_table = setmetatable({}, {__mode="v"}) 官 ...

  6. Table Properties [AX 2012]

    Table Properties [AX 2012] 1 out of 2 rated this helpful - Rate this topic Updated: July 20, 2012 Ap ...

  7. DDL中drop-alter table

    一.DROP TABLE语句:用于删除数据表 DROP TABLE removes one or more tables. You must have the DROP privilege for e ...

  8. oracle temporary table

    oralce 有两种临时表  a.会话级临时表 b.事物级临时表 A.事物级临时表 语法 create  global temporary table table_name( col1  type1, ...

  9. snowflake 分布式唯一ID生成器

    本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn 摘要: 原文参考运维生存和开源中国上的代码整理 我的环境是pytho ...

随机推荐

  1. jquery实现表格中点击相应行变色功能

    对于一个表格,为了使我们选中的项更容易区分,需要为选中项添加高亮,同时也需要,将其他项的高亮形式去除.类似于: <!DOCTYPE html> <html lang="en ...

  2. IDEA默认常用快捷键

    作为Java的利器,IDEA属实是非常好用,参考网文总结其常用快捷键如下: Ctrl + /(Ctrl + Shift + /):注释或反注释指定的语句.这个是本人最喜欢的,所以排在第一位. Ctrl ...

  3. 不可或缺 Windows Native (7) - C 语言: 指针

    [源码下载] 不可或缺 Windows Native (7) - C 语言: 指针 作者:webabcd 介绍不可或缺 Windows Native 之 C 语言 指针 示例cPointer.h #i ...

  4. sql 去重

    ;WITH CETAS (SELECT *, ROW_NUMBER() OVER (PARTITION BY SearchTask_PKID ORDER BY SearchTask_PKID) Row ...

  5. 小白学Linux(二)--命令行基本操作

    安装完Ubuntu后,进入系统,呈现在眼前的是Ubuntu的界面,跟windows的差不太多.一般操作系统包含GUI和CLI.GUI就是我们现在看到的,也是windows常用的直接用拖拽,点击等操作对 ...

  6. 序列中找子序列的dp

    题目网址: http://codeforces.com/problemset/problem/414/B Description Mashmokh's boss, Bimokh, didn't lik ...

  7. 性能分析之-- JAVA Thread Dump 分析综述

    性能分析之-- JAVA Thread Dump 分析综述       一.Thread Dump介绍 1.1什么是Thread Dump? Thread Dump是非常有用的诊断Java应用问题的工 ...

  8. 初学Node(四)事件循环

    Node中的事件循环 事件循环是Node的核心,正是因为有了事件循环JS才能够在服务端占有一席之地.JS是一种单线程语言,但是它的执行环境是多线程的在加上JS的事件驱动这一特点,使使JS在执行的过程中 ...

  9. QT5中全屏显示子窗口和取消全屏的方法

    问题描述:用QT5做了个MDI多窗体应用程序,想把子窗体全屏显示,用网上的方法,但总是遇到问题. 网上的解决方法原文在这:http://www.cnblogs.com/Rick-w/archive/2 ...

  10. IOS 网络浅析-(九 NSURLSession代理简介)

    从最开始什么都不懂的小白,到到现在略知一二的小孩.我觉得不仅仅是我,大家应该都会注意到代理几乎贯穿着IOS,那么问题来了,我接下来要说什么呢,那就是.标题的内容啦.上篇网络系列的文章我介绍了NSURL ...