A Nonunique Composite Foreign Key-Based Approach to Fact Table Modeling and MDX Query Composing

비유일 외래키 조합 복합키 기반의 사실테이블 모델링과 MDX 쿼리문 작성법

  • 유한주 (숭실대학교 산업.정보시스템공학과) ;
  • 이덕성 (숭실대학교 산업.정보시스템공학과) ;
  • 최인수 (숭실대학교 산업.정보시스템공학과)
  • Published : 2006.12.15

Abstract

A star schema consists of a central fact table, which is surrounded by one or more dimension tables. Each row int the fact table contains a multi-part primary key(or a composite foreign key) along with one or more columns containing various facts about the data stored in the row Each of the composit foreign key components is related to a dimensional table. The combination of keys in the fact table creates a composite foreign key that is unique to the fact table record. The composite foreign key, however, is rarely unique to the fact table record in real-world applications, particularly in financial applications. In order to make the composite foreign key be the determinant in real-world application, some precalculation might be performed in the SQL relational database, and cached in the OLAP database. However, there are many drawbacks to this approach. In some cases, this approach might give users the wrong results. In this paper, an approach to fact table modeling and related MDX query composing, which can be used in real-world applications without performing any precalculation and gives users the correct results, is proposed.

스타 스키마는 중앙에 사실테이블이 있고 이 주변에 여러 개의 차원테이블이 감싸고 있는 형태로 되어있다. 사실테이블에서의 각 행은 여러 외래키로 구성된 하나의 복합키와 이 복합키와 관련된 여러 측정값으로 구성된다. 복합키의 구성원인 각 외래키는 각 하나씩의 차원테이블과 관련을 맺고 있다. 그런데 문제가 되는 것은 OLAP 스키마에서는 사실테이블에서의 복합키와 측정값이 1 : 1의 관계를 맺고 있는 것으로 되어있는데 비해서 실제의 애플리케이션 특히 금융 애플리케이션에 있어서는 복합키와 측정값이 1 : N의 관계를 맺게 된다는 점이다. 따라서 1 : N의 관계를 1 : 1로 만들기 위해서 예를 들면 SQL 데이터베이스에서 미리 필요한 처리를 한 다음 이 선처리 결과를 OLAP 데이터베이스에 입력하는 방법을 취하게 되는데, 이 방법에도 여러 문제가 있는 것으로 알려져 있다. 특히 어떤 경우에는 결과값이 틀리게 나오기도 한다. 본 연구에서는 1 : N의 관계를 사실테이블에 유지를 하면서도 어떠한 선처리도 하지 않고 정확한 결과값을 산출할 수 있는 사실테이블의 모델링과 MDX 쿼리문 작성법을 제안하고 있다.

Keywords