2017년 6월 7일 수요일

Dimension Processing Architecture (Analysis Services Performance Guide for SQL Server 2012 and SQL Server 2014)

4.2.1 Dimension Processing Architecture



dimension stores를 생성하기 위해, storeage engine은 다음 다이어그램에 표시된 일련의 작업을 사용한다.


[그림 - Dimension processing jobs]

dimention은 다음 확장명으로 저장된다.
  • Hierarchy stores : *.ostore, *.sstore and *.lstore
  • Key store : *.kstore, *.khstore and *.ksstore
  • Name Store : *.asstore, *.ahstore and *.hstore
  • Relationship store : *.data and *.data.hdr
  • Decoding Stores : *.dstore
  • Bitmap indexes : *.map and *.map.hdr



[그림]

1. Build Attributes Stores
- dimension의 각 attribute에 대해 작업이 인스턴스화되어 attribute member를 추출하여 attribute store에 저장한다.
- Attributes Store의 구성 : ①key store, ②name store, ③relationship store
- storage engine attribute간의 dependency를 분석하고 실행순서(execution tree)를 만든다.
- 그런 다음 실행순서를 사용하여 dimension처리의 최적 병렬 실행을 결정한다.

[그림 - time dimension execution tree]

- 실선은 차원의 특성관계를 나타낸다.
- 점선은 All Attribute에 대한 각 Attribute의 암시적관계를 나타낸다.

- All attribute처음으로 처리된다. (All attribute dependency 가 없으므로..) 
- Fiscal Year, Calendar Year attribute가 이후에 병렬로 처리된다.
- Fiscal Year → Fiscal Quarter .... 순으로 처리된다
- key attribute마지막에 처리된다. (항상 하나 이상의 attribute relationship이 있으므로..)



 

[카드 dimension]



[카드 dimension 특성관계]

[execution tree]

[All attribute가 처음 처리]


[카드그룹 > 카드 순으로 처리]









[계층 처리]



[인덱스 처리]


처리메시지 ----------------------------------------------------
처리 일정 작성이 시작되었습니다.
처리 일정이 작성되었습니다.
'카드' 차원 처리를 시작했습니다.
'(All)' 특성 처리를 시작했습니다.
'(All)' 특성의 데이터 읽기를 시작했습니다.
'(All)' 특성에 대한 데이터를 썼습니다.
'(All)' 특성이 처리되었습니다.
'카드그룹' 특성 처리를 시작했습니다.
'카드그룹' 특성의 데이터 읽기를 시작했습니다.
SQL 문 시작: SELECT 
DISTINCT
[dbo_VD_CRD].[카드그룹] AS [dbo_VD_CRD카드그룹0_0]
FROM [dbo].[VD_CRD] AS [dbo_VD_CRD]
SQL 문 끝: SELECT 
DISTINCT
[dbo_VD_CRD].[카드그룹] AS [dbo_VD_CRD카드그룹0_0]
FROM [dbo].[VD_CRD] AS [dbo_VD_CRD]
'카드그룹' 특성에 대한 데이터를 썼습니다.
'카드그룹' 특성에서 데이터 읽기를 시작했습니다.
'카드그룹' 특성에서 데이터를 읽었습니다.
'카드그룹' 특성이 처리되었습니다.
'카드' 특성 처리를 시작했습니다.
'카드' 특성의 데이터 읽기를 시작했습니다.
SQL 문 시작: SELECT 
DISTINCT
[dbo_VD_CRD].[카드ID] AS [dbo_VD_CRD카드ID0_0],[dbo_VD_CRD].[카드명] AS [dbo_VD_CRD카드명0_1],[dbo_VD_CRD].[카드그룹] AS [dbo_VD_CRD카드그룹0_2]
FROM [dbo].[VD_CRD] AS [dbo_VD_CRD]
'카드그룹' 계층 처리를 시작했습니다.
'카드그룹' 계층이 처리되었습니다.
실행이 완료되었습니다.
----------------------------------------------------------------------------------------------



- attribute의 처리시간은 다음 요소들에 달려있다.
1) member의 수
2) attribute relationship의 수

- member의 수를 제어 할 수는 없지만 계단식 attribute relationship을 사용하여 처리 성능을 향상시킬 수 있다.
- key attribute에 특히 중요 : 구성원이 가장 많고 다른 모든 작업 (hierarchy, decoding, bitmap indexes)이 완료되기를 기다리고 있기 때문

- 일반적으로 attribute relationship 사용하면 처리 중에 메모리 요구 사항이 낮아진다.
- attribute가 처리 될 때 모든 dependent attribute는 메모리에 유지되어야 한다.

- attribute relationship이 없다면 key attribute가 처리되는 동안 모든 attribute는 메모리에 있다 (out-of-memory 유발)


2. Build Decoding Stores
- during querying, 차원에서 데이터를 검색하는 데 사용된다.
- 처리 중에 차원의 비트 맵 인덱스를 작성하는 데 사용된다.


3. Build Hierarchy Stores
- A hierarchy store is a persistent representation of the tree structure.
- For each natural hierarchy in the dimension, a job is instantiated to create the hierarchy stores.

4. Build Bitmap Indexes
- 질의시 Relationship store에서 attribute data를 효율적으로 찾기 위해 저장소 엔진은 처리 시간에 bitmap index를 생성한다.
- bitmap index는 중요한 쿼리 이점을 제공하지만, 높은 카디널리티 특성이 있을 때는 비추천한다.
(비트 맵 인덱스가 제공하는 쿼리 이점은 비트 맵 인덱스를 만드는 데 드는 처리 비용보다 중요하지 않을 수 있다.)

댓글 없음:

댓글 쓰기