11

OLAP データベースは、非正規化形式のデータで構成されています。これはデータの冗長性を意味し、このデータの冗長性により、少ない結合回数でデータを取得できるため、取得が高速になります。

しかし、OLAP データベースの一般的な設計は、ファクト ディメンション モデルです。ファクト テーブルには数値のファクト ベースのエントリ (販売数など) が格納され、ディメンション テーブルにはファクトに関連する「記述属性」、つまり販売先の顧客の詳細が格納されます。

私の質問は、この設計では、すべてのディメンション テーブルにファクト テーブルへの外部キー参照があるため、まったく非正規化されていないように見えるということです。OLTP 設計との違いは何ですか?

4

2 に答える 2

1
You can get the difference if you study first "highly normalized schemas".
https://www2.microstrategy.com/producthelp/10.6/ProjectDesignGuide/WebHelp/Lang_1033/Content/ProjectDesign/Highly_normalized_schema__Minimal_storage_space.htm

Will give you an example: Consider a "city" inside a "country" for a "person",
all what you need to store for a person is only his "city" because anyway that city resides in a "country". 
so you don't have also to store the "country" in the "person" table. 
This approach will have advantage of "minimal" storage. 
But as disadvantage it will be annoying to retrieve "country" for a "person"
 since you will have to do many joins to achieve that.

So regarding your question, in your design, if we stored both "city_id" and "country_code" in "person" table, 
this will cause little redundancy but as advantage it will be more easier to get "person" "country" by directly joining the two tables "Countries" and "person" together. 

Normalization main purpose is to remove redundancy. And to achieve data consistency. 
For example, in your case OLAP , developer can make mistake by inserting correct "city_id" and wrong "country_id" 
for example he can insert "Paris" as city and by mistake he can insert "Germany" as the country which is wrong.
If the schema is fully normalized, this cannot never happens since it will store only "Paris" "city id" in "party" table and will not store "country" id.

  So yes, OLAP is de-normalized since it allows data redundancy and developers (application) mistakes (if any).
于 2018-10-26T20:36:27.557 に答える