Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
ITS423: Data Warehouses and Data Mining!
Topics
! What
Lecture 2 Data Warehouses &
OLAP Technology
Virach Sornlertlamvanich
Thanaruk Theeramunkong
Sirindhorn International Institute of Technology
Thammasat University
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
1!
* What is Data warehouse ?
What is Data Warehouse?
!
!
!
Defined in many different ways, but not rigorously.
" A decision support database that is maintained
separately from the organization’s operational DB
" Support information processing by providing a solid
platform of consolidated, historical data for analysis.
“A data warehouse is a subject-oriented, integrated,
time-variant, and nonvolatile collection of data in
support of management’s decision-making process.”
by W. H. Inmon
Data warehousing:
" Process of constructing and using data warehouses
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
3!
is a data warehouse?
! A multi-dimensional data model
! Data warehouse architecture
! Data warehouse implementation
! Further development of data cube
technology
! From data warehousing to data mining
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
2!
Data Warehouse - Subject-Oriented
!
!
!
Organized around major subjects, such as
customer, product, sales.
Focusing on the modeling and analysis of data for
decision makers, not on daily operations or
transaction processing.
Provide a simple and concise view around
particular subject issues by excluding data that are
not useful in the decision support process.
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
4!
Data Warehouse - Integrated
!
Constructed by integrating multiple, heterogeneous
data sources
" relational databases, flat files, on-line transaction
records
Data cleaning and data integration techniques are
applied.
" Ensure consistency in naming conventions,
encoding structures, attribute measures, etc. among
different data sources
!
"
!
"
"
!
When data is moved to the warehouse, it is
converted.
Data Warehouses and OLAP!
"
5!
Data Warehouse - Non-Volatile
A physically separate store of data transformed
from the operational environment.
! Operational update of data does not occur in
the data warehouse environment.
Does not require transaction processing, recovery,
and concurrency control mechanisms
" Requires only two operations in data accessing:
! initial loading of data and access of data.
"
Data Warehouses and OLAP!
Contains an element of time, explicitly or implicitly
But the key of operational data may or may not contain
“time element”.
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
6!
Data Warehouse Process
!
ITS423: Data Warehouses and Data Mining!
Operational database: current value data.
Data warehouse data: provide information from a
historical perspective (e.g., past 5-10 years)
Every key structure in the data warehouse
"
e.g., Hotel price: currency, tax, breakfast covered, etc.
ITS423: Data Warehouses and Data Mining!
The time horizon for the data warehouse is
significantly longer than that of operational
systems.
7!
ETL
Extract, Transform, & Loading
!
Data Warehouse - Time Variant
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
8!
Data Warehouse vs. Heterogeneous DBMS
!
Traditional heterogeneous DB integration:
" Build wrappers/mediators on top of heterogeneous DBs
" Query driven approach
!
!
!
When a query is posed to a client site, a meta-dictionary is
used to translate the query into queries appropriate for
individual heterogeneous sites involved, and the results are
integrated into a global answer set
Complex information filtering, compete for resources
Data Warehouse vs. Operational DBMS
!
OLTP (on-line transaction processing)
"
"
!
Major task of traditional relational DBMS
Day-to-day operations: purchasing, inventory, banking,
manufacturing, payroll, registration, accounting, etc.
OLAP (on-line analytical processing)
"
"
Major task of data warehouse system
Data analysis and decision making
Data warehouse: update-driven, high performance
" Information from heterogeneous sources is integrated in
advance and stored in warehouses for direct query and
analysis
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
9!
Data Warehouse vs. Operational DBMS
!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
10!
Data Warehouses and OLAP!
12!
OLTP vs. OLAP
Distinct features (OLTP vs. OLAP):
"
"
"
"
"
User and system orientation: customer vs. market
Data contents: current, detailed vs. historical, consolidated
Database design: ER + application vs. star + subject
View: current, local vs. evolutionary, integrated
Access patterns: update vs. read-only but complex queries
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
11!
ITS423: Data Warehouses and Data Mining!
OLTP vs. OLAP
Why Separate Data Warehouse?
!
High performance for both systems
"
"
!
Different functions and different data:
"
"
"
http://datawarehouse4u.info//OLTP-vs-OLAP.html
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
13!
From Tables and Spreadsheets to
* A multi-dimensional data model
Data Cubes
!
!
A data warehouse is based on a multidimensional data
model which views data in the form of a data cube
A data cube, such as sales, allows data to be modeled and
viewed in multiple dimensions
"
"
!
DBMS— tuned for OLTP: access methods, indexing,
concurrency control, recovery
Warehouse—tuned for OLAP: complex OLAP queries,
multidimensional view, consolidation.
missing data: Decision support requires historical data
which operational DBs do not typically maintain
data consolidation: Decision support requires consolidation
(aggregation, summarization) of data from heterogeneous
sources
data quality: different sources typically use inconsistent data
representations, codes and formats which have to be
reconciled
ITS423: Data Warehouses and Data Mining!
Cube: A Lattice of Cuboids Number of Cuboid = 2
n
all
time
item
D (apex) cuboid
location
time,location
item,location
time,supplier
In data warehousing literature, an n-D base cube is called
a base cuboid. The top most 0-D cuboid, which holds the
highest-level of summarization, is called the apex cuboid.
The lattice of cuboids forms a data cube.
supplier
D cuboids
time,item
Dimension tables, such as item (item_name, brand, type), or time(day,
week, month, quarter, year)
Fact table contains measures (such as dollars_sold) and keys to each of
the related dimension tables
14!
Data Warehouses and OLAP!
location,supplier
item,supplier
D cuboids
time,location,supplier
time,item,location
D cuboids
time,item,supplier
item,location,supplier
D(base) cuboid
time, item, location, supplier
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
15!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
16!
An Example of Cuboids
"
!
all: SaleAmt(all) # Only one value
1-D cuboid
"
"
"
"
!
time, item, location, supplier
D (apex) cuboid
!
!
SaleAmt(December, all, all, all)
time: SaleAmt(Jan), SaleAmt(Feb), …, SaleAmt(Dec)
item: SaleAmt(milk), SaleAmt(shirt)
location: SaleAmt(BKK), SaleAmt(London), SaleAmt(New York)
supplier: SaleAmt(company X), SaleAmt(shop Y)
2-D cuboid
"
"
"
(time, item): SaleAmt(January, milk), SaleAmt(February,shirt)
(item,location): SaleAmt(milk,BKK), SaleAmt(shirt,London)
…
ITS423: Data Warehouses and Data Mining!
Conceptual Modeling of Data
Warehouses
17!
Data Warehouses and OLAP!
Example of Star Schema
Modeling data warehouses: dimensions & measures
" Star schema: A fact table in the middle connected
to a set of dimension tables
" Snowflake schema: A refinement of star schema
where some dimensional hierarchy is normalized
into a set of smaller dimension tables, forming a
shape similar to snowflake
" Fact constellations: Multiple fact tables share
dimension tables, viewed as a collection of stars,
therefore called galaxy schema or fact constellation
ITS423: Data Warehouses and Data Mining!
Example of Snowflake Schema
time
time
time_key
day
day_of_the_week
month
quarter
year
item
Sales Fact Table
time_key
item_key
branch_key
branch
branch_key
branch_name
branch_type
location_key
units_sold
dollars_sold
avg_sales
time_key
day
day_of_the_week
month
quarter
year
item_key
item_name
brand
type
supplier_type
item
Sales Fact Table
time_key
item_key
branch_key
branch
location
location_key
street
city
province_or_street
country
branch_key
branch_name
branch_type
location_key
units_sold
dollars_sold
item_key
item_name
brand
type
supplier_key
location_key
street
city_key
Measures
Data Warehouses and OLAP!
19!
ITS423: Data Warehouses and Data Mining!
supplier
supplier_key
supplier_type
location
avg_sales
Measures
ITS423: Data Warehouses and Data Mining!
18!
Data Warehouses and OLAP!
Data Warehouses and OLAP!
city
city_key
city
province_or_street
country
20!
A Data Mining Query Language,
DMQL: Language Primitives
Example of Fact Constellation
Shipping Fact Table
time
time_key
day
day_of_the_week
month
quarter
year
item
Sales Fact Table
time_key
item_key
item_key
item_name
brand
type
supplier_type
branch_key
branch
branch_key
branch_name
branch_type
location_key
units_sold
dollars_sold
avg_sales
location
location_key
street
city
province_or_street
country
Measures
ITS423: Data Warehouses and Data Mining!
time_key
!
Cube Definition (Fact Table)
define cube <cube_name> [<dim_list>]: <measure_list>
item_key
shipper_key
!
from_location
Dimension Definition (Dimension Table)
define dimension <dimension_name> as <attr_or_subdim_list>)
to_location
!
dollars_cost
Special Case (Shared Dimension Tables)
First time as “cube definition”
units_shipped
define dimension <dimension_name>
as <dimension_name_first_time>
in cube<cube_name_first_time>
shipper
shipper_key
shipper_name
location_key
shipper_type
Data Warehouses and OLAP!
21!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
Defining a Star Schema in DMQL
Defining a Snowflake Schema in
DMQL
define cube sales_star [time, item, branch, location]:
dollars_sold = sum(sales_in_dollars), avg_sales =
avg(sales_in_dollars), units_sold = count(*)
define dimension time as (time_key, day, day_of_week,
month, quarter, year)
define dimension item as (item_key, item_name, brand,
type, supplier_type)
define dimension branch as (branch_key, branch_name,
branch_type)
define dimension location as (location_key, street, city,
province_or_state, country)
define cube sales_snowflake [time, item, branch, location]:
dollars_sold = sum(sales_in_dollars), avg_sales =
avg(sales_in_dollars), units_sold = count(*)
define dimension time as (time_key, day, day_of_week,
month, quarter, year)
define dimension item as (item_key, item_name, brand,
type, supplier(supplier_key, supplier_type))
define dimension branch as (branch_key, branch_name,
branch_type)
define dimension location as (location_key, street,
city(city_key, province_or_state, country))
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
23!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
22!
24!
Defining a Fact Constellation in DMQL
Measures: Three Categories
define cube sales [time, item, branch, location]:
dollars_sold = sum(sales_in_dollars), avg_sales = avg(sales_in_dollars),
units_sold = count(*)
define dimension time as (time_key, day, day_of_week, month, quarter,
year)
define dimension item as (item_key, item_name, brand, type,
supplier_type)
define dimension branch as (branch_key, branch_name, branch_type)
define dimension location as (location_key, street, city, province_or_state,
country)
define cube shipping [time, item, shipper, from_loc, to_loc]: dollar_cost =
sum(cost_dollars), unit_shipped = count(*)
define dimension time as time in cube sales
define dimension item as item in cube sales
define dimension shipper as (shipper_key, shipper_name, location as
location in cube sales, shipper_type)
define dimension from_location as location in cube sales
define dimension to_location as location in cube sales
ITS423: Data Warehouses and Data Mining!
!
!
!
25!
Data Warehouses and OLAP!
ITS423: Data Warehouses and Data Mining!
A Concept Hierarchy: Dimension
(location)
all
country
city
Europe
Germany
Frankfurt
...
...
all
...
Spain
North_America
Canada
Vancouver ...
...
all sum = 2100
sum = 1400
Europe
region
Mexico
sum = 900
country
Germany
ITS423: Data Warehouses and Data Mining!
L. Chan
sum = 700
North_America
sum = 500
Spain
sum = 600 sum = 100
Canada Mexico
city Frankfurt Berlin Aechen Segovia Madrid Vancouver Toronto
Toronto
400
office
200
300
400
100
... M. Wind
Data Warehouses and OLAP!
26!
Data Warehouses and OLAP!
A Concept Hierarchy: Dimension
(Distributive - count(), sum(), min(), max().)
all
region
Distributive: if the result derived by applying the function
to n aggregate values is the same as that derived by
applying the function on all the data without partitioning.
! e.g., count(), sum(), min(), max().
Algebraic: if it can be computed by an algebraic function
with M arguments (where M is a bounded integer), each of
which is obtained by applying a distributive aggregate
function.
! e.g., avg(), min_N(), standard_deviation().
Holistic: if there is no constant bound on the storage size
needed to describe a subaggregate.
! e.g., median(), mode(), rank().
27!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
200
400
Mexico
100
28!
A Concept Hierarchy: Dimension
(Algebraic - avg(), min_N(), standard_deviation())
all
all avg = 262.5
avg = 300
country
Germany
region
avg = 300 avg = 100
Canada Mexico
median = 300
country
Germany
count=2
count=2
200
ITS423: Data Warehouses and Data Mining!
300
400
100
Data Warehouses and OLAP!
200
!
!
ITS423: Data Warehouses and Data Mining!
median = 200
North_America
median = 250 median = 300
Spain
Canada Mexico
median = 100
city Frankfurt Berlin Aechen Segovia Madrid Vancouver Toronto
400
400
Mexico
100
29!
View of Warehouses and Hierarchies
!
median = 300
Europe
count=1
city Frankfurt Berlin Aechen Segovia Madrid Vancouver Toronto
400
all median = 250
avg = 233.33
North_America
count=3
avg = 250
Spain
count=3
all
count=8
avg = 280
count=5
Europe
region
A Concept Hierarchy: Dimension
(Holistic - median(), mode(), rank())
200
ITS423: Data Warehouses and Data Mining!
300
400
100
200
Data Warehouses and OLAP!
400
Mexico
100
30!
An Example of OLAP tools
Specification of
hierarchies
Schema hierarchy
" day < {month <
quarter; week} < year
Set_grouping hierarchy
" {1..10} < inexpensive
Data Warehouses and OLAP!
31!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
32!
A Sample Data Cube
!
Sales volume as a function of product, month, and
region
Dimensions: Product, Location, Time
Hierarchical summarization paths
Product
Industry Region
TV
PC
VCR
sum
1Qtr
2Qtr
Date
3Qtr
4Qtr
sum
Total annual sales
of TV in U.S.A.
U.S.A
Canada
Year
Mexico
Country
Multidimensional Data
Category Country Quarter
Product
City
Office
sum
Month Week
Day
Month
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
33!
Browsing a Data Cube
!
!
!
ITS423: Data Warehouses and Data Mining!
!
Roll up (drill-up): summarize data
"
!
!
"
reorient the cube, visualization, 3D to series of 2D planes.
Other operations
"
"
35!
project and select
Slice (select on 1 dim.), dice (select on 2 or more dim.)
Pivot (rotate):
"
!
from higher level summary to lower level summary or detailed data, or
introducing new dimensions
Slice and dice:
"
!
by climbing up hierarchy or by dimension reduction
Drill down (roll down): reverse of roll-up
"
Data Warehouses and OLAP!
34!
Typical OLAP Operations
Visualization
OLAP capabilities
Interactive manipulation
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
drill across: involving (across) more than one fact table
drill through: through the bottom level of the cube to its back-end
relational tables (using SQL)
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
36!
Each circle is called a
footprint
A Star-Net Query
Model
Customer Orders
Shipping Method
Customer Sex
CONTRACTS
AIR-EXPRESS
MALE/FEMALE
!
Four views regarding the design of a data warehouse
"
ORDER
TRUCK
Time
PRODUCT LINE
ANNUALY QTRLY
Design of a Data Warehouse:
A Business Analysis Framework
DAILY
"
PRODUCT ITEM PRODUCT GROUP
Product
CITY
SALES PERSON
"
COUNTRY
DISTRICT
"
REGION
Location
ITS423: Data Warehouses and Data Mining!
DIVISION
Promotion
Organization
Data Warehouses and OLAP!
37!
"
other
sources
From software engineering point of view
"
"
!
Bottom Tier!
Top-down: Starts with overall design and planning (mature)
Bottom-up: Starts with experiments and prototypes (rapid)
Waterfall: structured and systematic analysis at each step before
proceeding to the next
Spiral: rapid generation of increasingly functional systems, short
turn around time, quick turn around
Load
Refresh
Typical data warehouse design process
"
"
"
"
Metadata
Operational Extract
Transform
DBs
Choose a business process to model, e.g., orders, invoices, etc.
Choose the grain (atomic level of data) of the business process
Choose the dimensions that will apply to each fact table record
Choose the measure that will populate each fact table record
Data Warehouses and OLAP!
Middle Tier!
Monitor
&
Integrator
Data
Warehouse
Top Tier!
OLAP Server
Serve
Analysis
Query
Reports
Data
mining
Data Marts
Data Sources
ITS423: Data Warehouses and Data Mining!
38!
Data Warehouses and OLAP!
Top-down, bottom-up approaches or a combination of both
"
!
ITS423: Data Warehouses and Data Mining!
Multi-Tiered Architecture
Data Warehouse Design Process
!
Top-down view
! allows selection of the relevant information necessary for
the data warehouse
Data source view
! exposes the information being captured, stored, and
managed by operational systems
Data warehouse view
! consists of fact tables and dimension tables
Business query view
! sees the perspectives of data in the warehouse from the
view of end-user
* Data Warehouse Architecture
39!
ITS423: Data Warehouses and Data Mining!
Data Storage
OLAP Engine Front-End Tools
Data Warehouses and OLAP!
40!
DW Development: A Recommended Approach
Three Data Warehouse Models
!
!
Enterprise Warehouse
" collects all of the information about subjects spanning the
entire organization
Data Mart
" a subset of corporate-wide data that is of value to a specific
groups of users. Its scope is confined to specific, selected
groups, such as marketing data mart
!
!
Multi-Tier Data
Warehouse
Independent vs. dependent (directly from warehouse) data mart
Data Warehouses and OLAP!
41!
OLAP Server Architectures
!
"
"
"
Model refinement
Define a high-level corporate data model
ITS423: Data Warehouses and Data Mining!
!
Use relational or extended-relational DBMS to store and manage
warehouse data and OLAP middle ware to support missing pieces
Include optimization of DBMS backend, implementation of
aggregation navigation logic, and additional tools/services
greater scalability, we may keep summary in relational DB
Array-based multidimensional storage engine(sparse matrix
techniques)
fast indexing to pre-computed summarized data
Data Warehouses and OLAP!
42!
Data cube can be viewed as a lattice of cuboids
"
"
"
!
Hybrid OLAP (HOLAP)
"
!
Model refinement
The bottom-most cuboid is the base cuboid
The top-most cuboid (apex) contains only one cell
How many cuboids in an n-dimensional cube with L levels?
Multidimensional OLAP (MOLAP)
"
!
Enterprise
Data
Warehouse
Data
Mart
Efficient Data Cube Computation
Relational OLAP (ROLAP)
"
!
Data
Mart
Virtual Warehouse
" A set of views over operational databases
" Only some of the possible summary views may be
materialized
" Easy to build but require excess capacity on operational DB
server.
ITS423: Data Warehouses and Data Mining!
(include OLAP Server)
Distributed
Data Marts
"
User flexibility, e.g., low level: relational, high-level: array
Specialized SQL servers
"
Materialization of data cube
"
specialized support for SQL queries over star/snowflake schemas
in read-only environment.
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
43!
Materialize every (cuboid) (full materialization), none (no
materialization), or some (partial materialization)
Selection of which cuboids to materialize
!
Based on size, sharing, access frequency, etc.
* Data warehouse implementation
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
44!
Multi-way Array Aggregation for
Cube Computation
Cube Operation
!
Cube definition and computation in DMQL
!
define cube sales[item, city, year]: sum(sales_in_dollars)
compute cube sales
--> compute all of 8 subsets of the set {item, city, year}
!
Transform it into a SQL-like language (with a new
operator cube by, introduced by Gray et al.’96)
SELECT item, city, year, SUM (amount)
FROM SALES
CUBE BY item, city, year
!
()
Partition arrays into chunks (a small subcube which fits in memory).
Compressed sparse array addressing: (chunk_id, offset)
Compute aggregates in “multiway” by visiting cube cells in the order
which minimizes the # of times to visit each cell, and reduces memory
access and storage cost.
C
(city)
!
!
(item)
c3 61
62
63
64
c2 45
46
47
48
c1 29
30
31
32
c0
(year)
Need compute the following Group-Bys
(year, item, city),
(city, item)
(year,item), (year, city), (item, city),
(year), (item), (city)
()
(city, year)
(item, year)
B
b3
B13
b2
9
b1
5
b0
(city, item, year)
14
15
60
44
28 56
40
24 52
36
20
16
1
2
3
4
a0
a1
a2
a3
What is the best traversing order
to do multi-way aggregation?
The size of the dimensions A, B,
and C is 6000, 1000, and 50000.
A
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
45!
Multi-way Array Aggregation for
Cube Computation
ITS423: Data Warehouses and Data Mining!
Multi-way Array Aggregation for
Cube Computation
C
B
C
c3 61
62
63
64
c2 45
46
47
48
c1 29
30
31
32
c0
B13
60
14
15
16
b3
44
28 56
b2 9
40
24 52
b1 5
36
20
2
3
4
b0 1
a0
a1
a2
B
a3
Data Warehouses and OLAP!
c3 61
62
63
64
c2 45
46
47
48
c1 29
30
31
32
c0
B13
60
14
15
16
b3
44
28 56
b2 9
40
24 52
b1 5
36
20
2
3
4
b0 1
a0
A
ITS423: Data Warehouses and Data Mining!
46!
Data Warehouses and OLAP!
a1
a2
a3
A
47!
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
48!
Multi-Way Array Aggregation for
Cube Computation (Cont.)
!
(An Example)
Suppose that a base cuboid has three dimensions A, B, C with the
following numbers of cells: |A| = 6,000, |B| = 1,000, |C| = 50,000. Suppose
that the dimensions A, B and C are partitioned into 6, 5 and 1000
portions for chunking, respectively.
" If each cube cell stores one measure with 4 bytes, what is the total size
of the computed cube if the cube is very dense? That is, calculate the
size of a base cuboid.
! The number of cells in the computed cube is
!
Method: the planes should be sorted and computed
according to their size in ascending order.
"
!
Multi-Way Array Aggregation
Idea: keep the smallest plane in the main memory, fetch and
compute only one chunk at a time for the largest plane
Limitation of the method: computing well only for a
small number of dimensions
"
"
If there are a large number of dimensions, “bottom-up
computation” and iceberg cube computation methods can be
explored. Iceberg cubes store only cube partitions where the
aggregate value is above some min. support.
ITS423: Data Warehouses and Data Mining!
49!
Data Warehouses and OLAP!
Multi-Way Array Aggregation for
Cube Computation (Cont.) C
One chunk includes
A: 6000/6
= 1000
B: 1000/5
=
200
C: 50000/1000 =
50
The space we need for
computing the cube is
(1) All elements of plane
AB:
= 6000x1000 cells
=
6000000 cells
=
24000000 bytes
(2) One row of plane BC:
=
1000x50 cells
=
50000 cells
=
200000 bytes
ITS423: Data Warehouses and Data Mining!
!
State the order for computing the chunks in the cube that requires the
least amount of space, and compute the total amount of main memory
space required for computing the 2-D planes.
50!
Data Warehouses and OLAP!
Indexing OLAP Data: Bitmap Index
!
!
!
B
(3) One chunk of plane AC:
=
1000x50 cells
=
50000 cells
=
200000 bytes
(4) One cube of ABC:
= 1000x200x50 cells
=
10000000 cells
=
40000000 bytes
Total memory for
keeping the result
= 64400000 bytes
= OLAP!
6.44x107 bytes. 51!
Data Warehouses and
4 x 3 x 1011 = 1.2x1012 bytes.
ITS423: Data Warehouses and Data Mining!
!
A
The total size of the computed cube is
"
"
6 x 103 x 103 x 5 x 104 = 3x1011 cells.
!
Index on a particular column
Each value in the column has a bit vector: bit-op is fast
Length of the bit vector: # of records in the base table
The i-th bit is set if the i-th row of the base table has the value
for the indexed column
This technique is not suitable for high cardinality domains
Base table
ITS423: Data Warehouses and Data Mining!
Index on Region
Data Warehouses and OLAP!
Index on Type
52!
Indexing OLAP Data: Join Indices
!
!
!
Efficient Processing OLAP Queries
Join index: JI(R-id, S-id) where R (Rid, …) joins S (S-id, …)
Traditional indices map the values to a
list of record ids
" It materializes relational join in JI file
and speeds up relational join — a
rather costly operation
In data warehouses, join index relates
the values of the dimensions of a star
schema to rows in the fact table.
!
"
!
!
E.g. fact table: Sales and two dimensions city
and product
A join index on city maintains for each distinct
city a list of R-IDs of the tuples recording the
Sales in the city
Join indices can span multiple dimensions
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
!
53!
Metadata Repository (1)
!
Determine to which materialized cuboid(s) the
relevant operations should be applied.
Exploring indexing structures and compressed vs.
dense array structures in MOLAP
Example 2.15
ITS423: Data Warehouses and Data Mining!
!
Description of the structure of the warehouse
! schema, view, dimensions, hierarchies, derived
data definition, data mart locations and contents
" Operational meta-data
! data lineage (history of migrated data and
transformation path), currency of data (active,
archived, or purged), monitoring information
(warehouse usage statistics, error reports, audit
trails)
"
Data Warehouses and OLAP!
transform drill, roll, etc. into corresponding SQL and/or
OLAP operations, e.g, dice = selection + projection
Data Warehouses and OLAP!
54!
Metadata Repository (2)
Meta data is the data defining warehouse
objects. It has the following kinds
ITS423: Data Warehouses and Data Mining!
Determine which operations should be performed
on the available cuboids:
Meta data is the data defining warehouse
objects. It has the following kinds
The algorithms used for summarization
" The mapping from operational environment to the
data warehouse
" Data related to system performance
"
!
"
Business data
!
55!
warehouse schema, view and derived data definitions
business terms and definitions, ownership of data,
charging policies
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
56!
Data Warehouse Back-End Tools
and Utilities
!
!
detect errors in the data and rectify them when possible
convert data from legacy or host format to warehouse format
"
sort, summarize, consolidate, compute views, check integrity,
and build indices and partitions
"
Refresh
"
"
propagate the updates from the data sources to the warehouse
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
Hypothesis-driven: exploration by user, huge search
space
Discovery-driven (Sarawagi et al.’98)
"
Load:
"
!
!
Data transformation:
"
!
get data from multiple, heterogeneous, and external sources
Data cleaning:
"
!
* Further development of data cube technology
Data extraction:
"
!
Discovery-Driven Exploration of
Data Cubes
57!
ITS423: Data Warehouses and Data Mining!
58!
Data Warehouse Usage
!
Three kinds of data warehouse applications
"
"
"
Data Warehouses and OLAP!
Data Warehouses and OLAP!
* From data warehousing to data mining
Discovery-Driven Data Cubes (Ex.)
ITS423: Data Warehouses and Data Mining!
Pre-compute measures indicating exceptions, guide user
in the data analysis, at all levels of aggregation
Exception: significantly different from the value
anticipated, based on a statistical model
Visual cues such as background color are used to reflect
the degree of exception of each cell
Computation of exception indicator (modeling fitting
and computing SelfExp, InExp, and PathExp values)
can be overlapped with cube construction
59!
Information processing
! supports querying, basic statistical analysis, and
reporting using crosstabs, tables, charts and graphs
Analytical processing
! multidimensional analysis of data warehouse data
! supports basic OLAP operations, slice-dice, drilling,
pivoting
Data mining
! knowledge discovery from hidden patterns
! supports associations, constructing analytical models,
performing classification and prediction, and
presenting the mining results using visualization tools.
ITS423: Data Warehouses and Data Mining!
Data Warehouses and OLAP!
60!
From OLAP to On Line Analytical
Mining (OLAM)
!
Mining query
Mining result
"
"
"
High quality of data in data warehouses
DW contains integrated, consistent, cleaned data
Available information processing structure surrounding data
warehouses
ODBC, OLEDB, Web accessing, service facilities, reporting and
OLAP tools
OLAP-based exploratory data analysis
mining with drilling, dicing, pivoting, etc.
On-line selection of data mining functions
integration and swapping of multiple mining functions,
algorithms, and tasks.
User GUI API
OLAM
Engine
Layer3
OLAP
Engine
OLAP/OLAM
Data Cube API
Layer2
MDDB
MDDB
Meta Data
Filtering&Integration
Database API
Multidimensional
DB
Filtering
Layer1
Architecture of OLAM
Databases
ITS423: Data Warehouses and Data Mining!
Layer4
User Interface
Why online analytical mining?
"
!
An OLAM Architecture (Online Analytical Mining)
Data Warehouses and OLAP!
61!
ITS423: Data Warehouses and Data Mining!
Data cleaning
Data integration
Data
Warehouse
Data Warehouses and OLAP!
Data Repository
62!