Documente Academic
Documente Profesional
Documente Cultură
UPRAVLJANJE
POSLOVNIM PODACIMA
DIMENZIJSKO MODELIRANJE
PROF. DRAENA GAPAR
15.01.2013.
INFORMACIJE
Novi plan nastave ubrzanje
Softver za formiranje kocke
http://www.bi-lite.com/product/DownloadCUBEitZERO.aspx
1/17/2013
NAPREDNI KONCEPTI
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Degenerativna dimenzija
Pahuljasta shema (Snowflaking)
Previe dimenzija
Surogatni kljuevi
Periodini snapshot
Poluzbrojive vrijednosti (fakti)
Data warehouse bus matrix
Podudarne dimenzije/fakti
Sporo promjenjive dimenzije
Dimenzije s viestrukim vrijednostima
DEGENERATE
DIMENSION
1/17/2013
DEGENERATE
DIMENSION
Consequence:
Two tables with a billion rows
Instead of one table with a billion rows.
It would be a degenerate dimension and
Order Number and Order Line Number
would be stored in the Fact table.
DEGENERATE
DIMENSION
1/17/2013
DEGENERATE DIMENSIONS
Example:
DIM CUSTOMER
Customer key
customer id
customer lname
customer fname
ORDERS TRANSACTIONS
order#
customer id
customer lname
customer fname
shipto street address
shipto city
shipto state
ORDERS FACTS
customer key
shipto address key
order date key
order total amount
discount amount
net order amount
payment amount
order#
shipto zip
order total amount
discount amount
net order amount
payment amount
order date
SNOWFLAKING
Normalized star schema
1/17/2013
SNOWFLAKING
Problems:
Increases
1/17/2013
SURROGATE
KEYS
1/17/2013
SURROGATE
Advantages
KEYS
Performance
Efficient joins
smaller indexes
more rows per block
Data integrity
SURROGATE
KEYS
1/17/2013
SURROGATE
KEYS
PERIODIC SNAPSHOT
At predetermined intervals snapshots of the
same level of details are taken and stacked
consecutively in the fact table
Example: most financial reports, bank account
value, inventory level
Complements detailed transaction facts but
not substitutes them
Share the same conformed dimensions but
have less dimensions
1/17/2013
TYPES OF FACTS
There are three types of facts:
Additive:
ADDITIVE FACTS
Date
Store
Product
Sales_Amount
The purpose of this table is to record the sales amount for each
product in each store on a daily basis.
Sales_Amount is the fact. In this case, Sales_Amount is an
additive fact, because you can sum up this fact along any of
the three dimensions present in the fact table -- date, store,
and product. For example, the sum of Sales_Amount for all 7
days in a week represent the total sales amount for that week.
1/17/2013
FACTS
Date
Account
Current_Balance
Profit_Margin
The purpose of this table is to record the current balance for each
account at the end of each day, as well as the profit margin for each
account for each day.
Current_Balance and Profit_Margin are the facts.
Current_Balance is a semi-additive fact, as it makes sense to add
them up for all accounts (what's the total current balance for all
accounts in the bank?), but it does not make sense to add them up
through time (adding up all current balances for a given account for
each day of the month does not give us any useful information).
Profit_Margin is a non-additive fact, for it does not make sense to
add them up for the account level or the day level.
CONFORMED
DIMENSIONS/FACTS
Master
types
Identical dimensions
One dimension being a subset of a more
detailed dimension
10
1/17/2013
CONFORMED
Identical
DIMENSIONS/FACTS
dimensions
One
CONFORMED DIMENSIONS
Sales Fact Table
Date key FK
Product key FK
other FKeys
Sales quantity
Sales amount
Product Dimension
Product key PK
Product description
SKU number
Brand description
Sub class description
Class description
Department description
Color
size
Display type
Brand Dimension
Brand key PK
Brand description
Sub class description
Class description
Department description
Display type
11
1/17/2013
CONFORMED DIMENSIONS
Benefits
Consistency
Integration
CONFORMED
FACTS
If
12
1/17/2013
CONFORMED
DIMENSIONS/FACTS
Master
types
Identical dimensions
One dimension being a subset of a more
detailed dimension
13
1/17/2013
14
1/17/2013
infrequently
A new column is added to the dimension table
Old value is recorded in a prior attribute
column
New value is recorded in the existing
column
All BI applications transparently use the
new attribute
Queries can be written to access values
stored in the prior attribute column
MM
-07
15
1/17/2013
Purchase Orders
Store Inventory
Store Sales
MM
roo
m,
Exe
Pgp
2004
-07
32
1/17/2013
During
Separate
16
1/17/2013
17
1/17/2013
Possible Problems:
Column-related
Generalized columns/dimensions
18
1/17/2013
DW 2.0
Modeling process
19
1/17/2013
DW 2.0 - MODELING
The starting point for DW2.0 is the modeling
process.
2 basic models:
Process model
Data model
20
1/17/2013
21
1/17/2013
22
1/17/2013
23
1/17/2013
24
1/17/2013
25
1/17/2013
26
1/17/2013
Preconditions:
Tables share a common key
Data from different tables is
used together frequently
Pattern of insertion is
roughly the same
27
1/17/2013
28
1/17/2013
Questions..
29