dimensional & fact

2019-08-27  本文已影响0人  鲸鱼酱375

1.Dimension Table

1.1 advanced dimensional

1.1.1 Conformed Dimension

1.1.2 Junk Dimension

Transactional business processes typically produce a number of miscellaneous, lowcardinality fl ags and indicators. Rather than making separate dimensions for each fl ag and attribute, you can create a single junk dimension combining them together.This dimension, frequently labeled as a transaction profi le dimension in a schema,does not need to be the Cartesian product of all the attributes’ possible values, but should only contain the combination of values that actually occur in the source data.

1.1.3 Degenerate Dimension

This degenerate dimension is placed in the fact table with the explicit acknowledgment that there is no associated dimension table. Degenerate dimensions are most common with transaction and accumulating snapshot fact tables.

1.1.4 Role-Playing Dimension

A single physical dimension can be referenced multiple times in a fact table, with each reference linking to a logically distinct role for the dimension. For instance, a fact table can have several dates, each of which is represented by a foreign key to the date dimension. It is essential that each foreign key refers to a separate view of the date dimension so that the references are independent. These separate dimension views (with unique attribute column names) are called roles.

1.1.5 Rapidly Changing

1.1.6 Rapidly Growing

1.1.7 Slowly Changing Dimensions

Type 0

Type 1

Type 2

there are two way to record these changes

Type 3

Type 4

Type 6

1.1.8 parent- child dimension

2.Fact Table

2.1 Facts / Measures

Additive Measures

Semi-Additive Measure

Non-Additive Measure

facts

2.2 fact table /measure groups

2.2.1 Cumulative

2.2.2 Snapshot

2.2.3 factless fact

2.2.4 inferred members/dimension

3.Determining Where Data Should Go

Dimension Table Fact Table
Contains Surrogate keys to replace old Primary Keys Contains Foreign keys that point to the Surrogate keys in various Dimensions to link descriptive info
Can also contain Business Keys to reference OLTP Designed to hold all measurement data or statistical data for use in analysis
Designed to hold all descriptive data to explain what the data in the Fact tables are or mean

7. 笔记

1.星星的中心是一个大的事实表,发散出来的是维度表,每一个维度表用一个PK-FK连接到事实表,维度表之间彼此并不关联。一个事实表又包括一些度量值和维度。

2.雪花模型通过规范维度表来减少冗余度,也就是说,维度表数据已经被分组成一个个的表而不是使用一个大表。例如产品表被分成了产品大类和产品小类两个表。尽管这样做可以节省了空间,但是却增加了维度表的数量和关联的外键的个数。这就导致了更复杂的查询并降低了数据库的效率

上一篇下一篇

猜你喜欢

热点阅读