Download Multi-dimensional Data Model - Data Warehousing - Lecture Slide and more Slides Data Warehousing in PDF only on Docsity!
Data Warehousing/Mining
Comp 150 DW
Data Warehousing and OLAP
Technology for Data Mining
Chapter 2: Data Warehousing and
OLAP Technology for Data
Mining
What 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
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.
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
E.g., Hotel price: currency, tax, breakfast covered, etc.
– When data is moved to the warehouse, it is
converted.
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 Warehouse vs. Heterogeneous
DBMS
Traditional heterogeneous DB integration:
- Build wrappers/mediators on top of heterogeneous databases
- 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: update-driven, high performance
- Information from heterogeneous sources is integrated in advance and stored in warehouses for direct query and analysis
OLTP vs. OLAP
OLTP OLAP
users clerk, IT professional knowledge worker
function day to day operations decision support
DB design application-oriented subject-oriented
data current, up-to-date detailed, flat relational isolated
historical, summarized, multidimensional integrated, consolidated usage repetitive ad-hoc
access read/write index/hash on prim. key
lots of scans
unit of work short, simple transaction^ complex query
# records accessed tens^ millions
#users thousands hundreds
DB size 100GB-TB 100GB-TB
metric transaction throughput query throughput, response
Why Separate Data Warehouse?
High performance for both systems
- DBMS— tuned for OLTP: access methods, indexing, concurrency
control, recovery
- Warehouse—tuned for OLAP: complex OLAP queries,
multidimensional view, consolidation.
Different functions and different data:
- 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
Cube: A Lattice of Cuboids
all
time item location supplier
time,item time,location
time,supplier
item,location
item,supplier
location,supplier
time,item,location
time,item,supplier
time,location,supplier
item,location,supplier
time, item, location, supplier
0-D(apex) cuboid
1-D cuboids
2-D cuboids
3-D cuboids
4-D(base) cuboid
Conceptual Modeling of
Data Warehouses
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
Example of Snowflake Schema
time_key day day_of_the_week month quarter year
time
location_key street city_key
location
Sales Fact Table
time_key
item_key
branch_key
location_key
units_sold
dollars_sold
Measures
item_key item_name brand type supplier_key
item
branch_key branch_name branch_type
branch
supplier_key supplier_type
supplier
city_key city province_or_street country
city
normalized
Example of Fact Constellation
time_key day day_of_the_week month quarter year
time
location_key street city province_or_street country
location
Sales Fact Table
time_key
item_key branch_key
location_key
units_sold
dollars_sold
Measures
item_key item_name brand type supplier_type
item
branch_key branch_name branch_type
branch
Shipping Fact Table
time_key
item_key shipper_key
from_location
to_location dollars_cost
units_shipped
shipper_key shipper_name location_key shipper_type
shipper
Docsity.com
Defining a Star 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)
Defining a Snowflake Schema in
DMQL
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))