Docsity

Multidimensional Modeling-Data Warehousing and Data Mining-Lecture 02 Slides-Computer Science, Appunti di Basi di Dati

Toggle sidebar
bg1
J. Gamper, Free University of Bolzano, DWDM 2011-12
Data Warehousing and Data Mining
– Multidimensional Modeling –
•Motivation
•Dimensions, facts, measures, and cubes
•Granularity
•Star and snowflake schema
•DW design process
•DW applications
•DW implementation
Acknowledgements: I am indebted to Michael Böhlen and Stefano Rizzi for
providing me their slides, upon which these lecture notes are based.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43

Anteprima parziale del testo

Scarica Multidimensional Modeling-Data Warehousing and Data Mining-Lecture 02 Slides-Computer Science e più Appunti in PDF di Basi di Dati solo su Docsity!

Data Warehousing and Data Mining

– Multidimensional Modeling –

  • Motivation
  • Dimensions, facts, measures, and cubes
  • Granularity
  • Star and snowflake schema
  • DW design process
  • DW applications
  • (^) DW implementation

Acknowledgements: I am indebted to Michael Böhlen and Stefano Rizzi for

providing me their slides, upon which these lecture notes are based.

Why a New Model?/

  • We know ER and OO modeling
  • All types of data are “ equal ”
  • ER/OO models serve many purposes, thus are

Flexible

General

  • No difference between:

 What is important

 What just describes the important

  • ER/OO models are large

 50-1000 entities/relations/classes

 Hard to get an overview

  • ER/OO models implemented in RDBMSes

 Normalized databases spread information

 When analyzing data, the information must be

integrated/joined again

The Dimensional Fact Model/

The DFM is a graphical conceptual model for data mart

design, devised to:

  1. lend effective support to conceptual design
  2. create an environment in which user queries may be formulated

intuitively

  1. make communication possible between designers and end users

with the goal of formalizing requirement specifications

  1. build a stable platform for logical design ( independently of the

target logical model )

  1. provide clear and expressive design documentation

The conceptual representation generated by the DFM

consists of a set of fact schemata that basically model facts,

measures, dimensions, and hierarchies

  • A fact is a concept relevant to decision-making processes. It typically

models a set of events taking place within a company (e.g., sales,

shipments, purchases, ...). It is essential that a fact have dynamic

properties or evolve in some way over time

  • A measure is a numerical property of a fact and describes a

quantitative fact aspect that is relevant to analysis (e.g., every sale is

quantified by its receipts)

  • A dimension is a fact property with a finite domain and describes an

analysis coordinate of the fact. Typical dimensions for the sales fact

are products, stores, and dates

dimension

measure

fact

A fact expresses a

many-to-many

relationship between its

dimensions

The Dimensional Fact Model/

  • The Dimensional Fact Model/

8

Events and aggregation

  • (^) A primary event is a particular occurrence of a fact, identified by one

n-ple made up of a value for each dimension. A value for each

measure is associated with each primary event

 In reference to the sales example, a possible primary event records that

10 packages of Shiny detergent were sold for total sales of $25 on

10/10/2008 in the SmartMart store

  • (^) Given a set of dimensional attributes ( group-by set ), each n-ple of

their values identifies a secondary event that aggregates all of the

corresponding primary events. Each secondary event is associated

with a value for each measure that sums up all the values of the

same measure in the corresponding primary events

 This makes it possible to use hierarchies to define the way you can

aggregate primary events and effectively select them for decision-making

processes. While the dimension in which a hierarchy takes root defines its

finest aggregation granularity, the other dimensional attributes

correspond to a gradually increasing granularity

10

conceptual schema

workload

data volume

constraints

logical schema

Logical

Design

Logical design

  • A phase aimed at determining a logical schema for the data mart

starting from a conceptual schema

 Choice of the type of logical schema

 Translation of conceptual schemata

 Optimization (view materialization, fragmentation)

  • It is based on different principles from those used in operational

databases

 data redundancy

 denormalization of relations

  • In the rest of this course, we use directly the logical (multidimensional)

model

The Multidimensional Model/

  • Multidimensional Model is a logical model and

has one purpose:

Data analysis

  • Better at that purpose than ERM

 Less flexible

 Not suited for OLTP systems

  • (^) More built in “meaning”

 What is important

 What describes the important

 What we want to optimize

 Automatic aggregations means easy querying

  • (^) Most popular data model for DW
  • Recognized by OLAP/BI tools

 Tools offer powerful query facilities based on MD design

Cube Example: Sales

5

Cubes

  • A cube may have many dimensions.

 More than 3 – the term ”hypercube” is sometimes used

 Theoretically no limit for the number of dimensions

 Typical cubes have 4-12 dimensions

  • But only 2-3 dimensions can be viewed at a time

 Dimensionality reduced by queries via

projection/aggregation

  • A cube consists of cells

 A given combination of dimension values

 A cell can be empty (no data for this combination)

 A sparse cube has many empty cells

 A dense cube has few empty cells

 Cubes become sparser for many/large dimensions

12

Dimension Schema and Instance

DateKey Date DateFull DayOfWeek CalMonth CalYear Weekday

1 01/01/02 Januar 1, 2002 Tuesday January 2002 Weekday

2 01/02/02 Januar 2, 2002 Wednesday January 2002 Weekday

3 01/03/02 Januar 3, 2002 Thursday January 2002 Weekday

4 01/04/02 Januar 4, 2002 Friday January 2002 Weekend

5 01/05/02 Januar 5, 2002 Saturday January 2002 Weekend

Date

DateKey

Date

DateFull

DayOfWeek

CalMonth

CalYear

Holiday

schema of dimension Date

instance of dimension Date

Date

Dimensions/

  • Dimensions are the core of multidimensional

databases

 Other types of databases do not support dimensions

  • Dimensions are used for

Selection of data

Grouping of data at the right level of detail

  • (^) Dimensions consist of dimension values

 Product dimension has values ”milk”, ”cream”, …

 Time dimension has values ”1/1/2001”, ”2/1/2001”,…

  • Dimension values may have an ordering

 Used for comparing cube data across values

u e.g., percentage of sales increase compared with last month

 Especially used for Time dimension

Concept Hierachy Example

  • A location dimension with attributes street , city ,

province_or_state , and country encodes

implicitly the following hierarchy

Instance

Facts

  • Facts represent the subject of the desired analysis

 The ”important” in the business that should be analyzed

  • A fact is most often identified via its dimension

values

 A fact is a non-empty cell

 Some models give facts an explicit identity

  • (^) Generally a fact should

 Be attached to exactly one dimension value in each

dimension

 Only be attached to dimension values in the bottom

levels

u e.g., if the lowest time granularity is day, for each fact the

exact day should be specified

u Some models do not require this