1

正規化されたデータ モデリングとディメンション データ モデリングのモデリング階層の違いがよくわかりません。あなたの時間と答えに感謝します。

4

1 に答える 1

1

トランザクション データベースの正規化されたスキーマでは、階層は次のようになります。

create table geopolitical_area (
  id bigint primary key,
  type text not null,
  name text not null,
  code char(2),
  parent_id bigint null references geopolitical_area(id)  
);

insert into geopolitical_area values
(1, 'Country', 'Canada', 'CA', null),
(2, 'Region', 'British Columbia', 'BC', 1);

同じテーブルへの外部キーに注意してください。

データ ウェアハウスの次元スキーマでは、階層は次のようになります。

create table dim_customer (
  id bigint,
  name text,
  country_name text,
  country_code char(2),
  region_name text,
  region_code char(2) ...
);

insert into dim_customer values
(666, 'Neil McGuigan', 'Canada', 'CA', 'British Columbia', 'BC' ...);

階層がフラット化されていることに注意してください。

多くの場合、OLAP を使用してデータ ウェアハウスを分析し、国 > 地域の階層について OLAP サーバーに通知します。

たとえば、Mondrian OLAP サーバーでは、階層は次のようになります。

<Dimension name="location">
  <Hierarchy>
    <Table name="dim_customer" />
    <Level name="Country" column="country_code" nameColumn="country_name" />
    <Level name="Region" column="region_code" nameColumn="region_name" />
  </Hierarchy>
</Dimension>
于 2013-09-06T17:47:36.513 に答える