Data Warehousing & OLAP

Similar documents
Data warehousing. Han, J. and M. Kamber. Data Mining: Concepts and Techniques Morgan Kaufmann.

Chapter 3, Data Warehouse and OLAP Operations

Data Warehousing and OLAP Technology

Data W a Ware r house house and and OLAP Week 5 1

Data Warehouse. MIT-652 Data Mining Applications. Thimaporn Phetkaew. School of Informatics, Walailak University. MIT-652: DM 2: Data Warehouse 1

Overview of Data Warehousing and OLAP

Data Mining for Knowledge Management. Data Warehouses

BUILDING BLOCKS OF DATAWAREHOUSE. G.Lakshmi Priya & Razia Sultana.A Assistant Professor/IT

Data Warehousing & OLAP

Lecture 2 Data warehousing

Database Applications. Advanced Querying. Transaction Processing. Transaction Processing. Data Warehouse. Decision Support. Transaction processing

Data Warehousing and Online Analytical Processing


Data Mining. Session 4 Main Theme Data Warehousing and OLAP. Dr. Jean-Claude Franchitti

2 Data Warehouse and OLAP Technology for Data Mining What is a data warehouse? Amultidimensional data model... 6

DATA WAREHOUSING AND OLAP TECHNOLOGY

TIES443. Lecture 3: Data Warehousing. Lecture 3. Data Warehousing. Course webpage:

DATA WAREHOUSING - OLAP

Data Warehousing & OLAP

This tutorial will help computer science graduates to understand the basic-toadvanced concepts related to data warehousing.

Learning Objectives. Definition of OLAP Data cubes OLAP operations MDX OLAP servers

Building Data Cubes and Mining Them. Jelena Jovanovic

OLAP and OLTP. AMIT KUMAR BINDAL Associate Professor M M U MULLANA

Introduction to Data Warehousing. Ms Swapnil Shrivastava

Data Warehousing and elements of Data Mining

OLAP & DATA MINING CS561-SPRING 2012 WPI, MOHAMED ELTABAKH

1960s 1970s 1980s 1990s. Slow access to

Data Warehousing. Read chapter 13 of Riguzzi et al Sistemi Informativi. Slides derived from those by Hector Garcia-Molina

1. OLAP is an acronym for a. Online Analytical Processing b. Online Analysis Process c. Online Arithmetic Processing d. Object Linking and Processing

Part 22. Data Warehousing

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 29-1

Lecture Data Warehouse Systems

Integrate multiple, heterogeneous data sources. Data cleaning and data integration techniques are applied

OLAP Systems and Multidimensional Expressions I

Week 3 lecture slides

CHAPTER 3. Data Warehouses and OLAP

Anwendersoftware Anwendungssoftwares a. Data-Warehouse-, Data-Mining- and OLAP-Technologies. Online Analytic Processing

Week 13: Data Warehousing. Warehousing

Lecture 2: Introduction to Business Intelligence. Introduction to Business Intelligence

2074 : Designing and Implementing OLAP Solutions Using Microsoft SQL Server 2000

Data Warehouse: Introduction

Published by: PIONEER RESEARCH & DEVELOPMENT GROUP ( 28

14. Data Warehousing & Data Mining

Lection 3-4 WAREHOUSING

A Technical Review on On-Line Analytical Processing (OLAP)

Data Warehousing: Data Models and OLAP operations. By Kishore Jaladi

CHAPTER 4 Data Warehouse Architecture

Data W a Ware r house house and and OLAP II Week 6 1

OLAP and Data Mining. Data Warehousing and End-User Access Tools. Introducing OLAP. Introducing OLAP

Data Warehousing. Outline. From OLTP to the Data Warehouse. Overview of data warehousing Dimensional Modeling Online Analytical Processing

Data Warehousing and OLAP Technology for Knowledge Discovery

Data Warehousing Systems: Foundations and Architectures

DATA WAREHOUSING APPLICATIONS: AN ANALYTICAL TOOL FOR DECISION SUPPORT SYSTEM

BUSINESS ANALYTICS AND DATA VISUALIZATION. ITM-761 Business Intelligence ดร. สล ล บ ญพราหมณ

Mario Guarracino. Data warehousing

A Critical Review of Data Warehouse

Outline. Data Warehousing. What is a Warehouse? What is a Warehouse?

LITERATURE SURVEY ON DATA WAREHOUSE AND ITS TECHNIQUES

Data Warehousing and OLAP.

Dimensional Modeling for Data Warehouse

Module 1: Introduction to Data Warehousing and OLAP

IST722 Data Warehousing

(Week 10) A04. Information System for CRM. Electronic Commerce Marketing

OLAP. Business Intelligence OLAP definition & application Multidimensional data representation

Basics of Dimensional Modeling

When to consider OLAP?

DATA CUBES E Jayant Haritsa Computer Science and Automation Indian Institute of Science. JAN 2014 Slide 1 DATA CUBES

M Designing and Implementing OLAP Solutions Using Microsoft SQL Server Day Course

Designing a Dimensional Model

Data Warehousing and Decision Support. Introduction. Three Complementary Trends. Chapter 23, Part A

Data Warehousing and OLAP

New Approach of Computing Data Cubes in Data Warehousing

Data Warehousing OLAP

CS2032 Data warehousing and Data Mining Unit II Page 1

Data Warehousing, OLAP, and Data Mining

Monitoring Genebanks using Datamarts based in an Open Source Tool

OLAP OLAP. Data Warehouse. OLAP Data Model: the Data Cube S e s s io n

Data Warehousing and Data Mining

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 16 - Data Warehousing

Enterprise Data Warehouse (EDW) UC Berkeley Peter Cava Manager Data Warehouse Services October 5, 2006

BUILDING OLAP TOOLS OVER LARGE DATABASES

PowerDesigner WarehouseArchitect The Model for Data Warehousing Solutions. A Technical Whitepaper from Sybase, Inc.

Why Business Intelligence

Fluency With Information Technology CSE100/IMT100

Data Warehouse design

DATA WAREHOUSE CONCEPTS DATA WAREHOUSE DEFINITIONS

An Overview of Data Warehousing, Data mining, OLAP and OLTP Technologies

BUILDING A WEB-ENABLED DATA WAREHOUSE FOR DECISION SUPPORT IN CONSTRUCTION EQUIPMENT MANAGEMENT

Overview. Data Warehousing and Decision Support. Introduction. Three Complementary Trends. Data Warehousing. An Example: The Store (e.g.

Data Warehouse Technology And The MSD Databases

Business Intelligence for SUPRA. WHITE PAPER Cincom In-depth Analysis and Review

What is OLAP - On-line analytical processing

University of Gaziantep, Department of Business Administration

Unit -3. Learning Objective. Demand for Online analytical processing Major features and functions OLAP models and implementation considerations

Chapter 2 Enterprise Data Management for Transaction and Analytical Processing

OLAP and Data Warehousing! Introduction!

Data Warehousing & OLAP

CHAPTER 5: BUSINESS ANALYTICS

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 15 - Data Warehousing: Cubes

IT0457 Data Warehousing. G.Lakshmi Priya & Razia Sultana.A Assistant Professor/IT

Transcription:

Data Warehousing & OLAP Data Mining: Concepts and Techniques Chapter 3 Jiawei Han and An Introduction to Database Systems C.J.Date, Eighth Eddition, Addidon Wesley, 4 1

What is Data Warehousing? What is OLAP? What is a Data Cube, what is a Cuboid? What is ROLAP, MOLAP, HOLAP 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 database 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. W. H. Inmon Data warehousing: The process of constructing and using data warehouses 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 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. 3

Data Warehouse Time Variant The time horizon for the data warehouse is significantly longer than that of operational systems 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 Contains an element of time, explicitly or implicitly But the key of operational data may or may not contain time element Data Warehouse Nonvolatile 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 4

Data Warehouse vs. Heterogeneous DBMS Traditional heterogeneous DB integration: A query driven approach Build wrappers/mediators on top of heterogeneous databases 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 usage repetitive ad-hoc historical, summarized, multidimensional integrated, consolidated access read/write lots of scans index/hash on prim. key unit of work short, simple transaction complex query # records accessed tens millions #users thousands hundreds DB size 100MB-GB 100GB-TB metric transaction throughput query throughput, response 5

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: DS 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 Note: There are more and more systems which perform OLAP analysis directly on relational databases What is OLAP? The term OLAP ( online analytical processing ) was coined in a white paper written for Arbor Software Corp. in 1993 Interactive process of creating, managing, analyzing and reporting on data Analyzing large quantities of data in realtime 6

OLAP Data is perceived and manipulated as though it were stored in a multidimensional array Ideas are explained in terms of conventional SQL-styled tables Data aggregation Data aggregation (agregação) in many different ways The number of possible groupings quickly becomes large The user has to consider all groupings Analytical processing problem 7

Queries for supplier-and-parts database 1) Get the total shipment quantity 2) Get total shipment quantities by supplier 3) Get total shipment quantities by part 4) Get the shipment by supplier and part SP S# S1 S1 S2 S2 S3 S4 P# P1 P1 QTY 300 300 400 8

1. SELECT SUM(QTY) AS TOTQTY FROM SP GROUP BY () ; TOTQTY 1600 2. SELECT S#, SUM(QTY) AS TOTQTY FROM SP GROUP BY (S#) ; S# S1 S2 S3 S4 TOTQTY 500 700 9

3. SELECT P#, SUM(QTY) AS TOTQTY FROM SP GROUP BY (P#) ; P# P1 TOTQTY 600 1000 4. SELECT S#, P#, SUM(QTY) AS TOTQTY FROM SP GROUP BY (S#,P#), S# S1 S1 S2 S2 S3 S4 P# P1 P1 TOTQTY 300 300 400 10

Drawbacks Formulation so many similar but distinct queries is tedious Executing the queries is expensive Make life easier, more efficient computation Single query GROUPING SETS, ROLLUP, CUBE options Added to SQL standard 1999 GROUPING SETS Execute several queries simultaneously SELECT S#, P#, SUM (QTY) AS TOTQTY FROM SP GROUP BY GROUPING SETS ( (S#), (P#) ) ; S# Single results table S4 Not a relation!! P1 600 missing information 1000 S1 S2 S3 P# TOTQTY 500 700 11

SELECT CASE GROUPING ( S# ) WHEN 1 THEN?? S# ELSE S# S1 AS S#, S2 CASE GROUPING ( P# ) S3 WHEN 1 THEN!! S4 ELSE P#?? AS P#,?? SUM ( QTY ) AS TOTQTY FROM SP GROUP BY GROUPING SETS ( ( S# ), ( P# ) ); P#!!!!!!!! P1 TOTQTY 500 700 600 1000 ROLLUP S# S1 P# P1 TOTQTY 300 S1 S2 P1 300 SELECT S#,P#, SUM ( QTY ) AS TOTQTY FROM SP GROUP BY ROLLUP (S#, P#) ; S2 S3 S4 400 S1 500 S2 700 S3 S4 1600 GROUP BY GROUPING SETS ( ( S#, P# ), ( S# ), ( ) ) 12

ROLLUP The quantities have been roll up (estender) for each supplier Rolled up along supplier dimension GROUP BY ROLLUP (A,B,...,Z) (A,B,...,Z) (A,B,...) (A,B) (A) () GROUP BY ROLLUP (A,B) is not symmetric in A and B! CUBE S# S1 S1 S2 P# P1 P1 TOTQTY 300 300 SELECT S#, P#, SUM ( QTY ) AS TOTQTY FROM SP GROUP BY CUBE ( S#, P#) ; S2 S3 S4 S1 S2 400 500 700 S3 S4 P1 600 P1 1000 1600 GROUP BY GROUPING SETS ( (S#, P#), ( S# ), ( P# ), ( ) ) 13

CUBE Confusing term CUBE (?) Derived from the fact that in multidimensional terminology,data values are stored in cells of a multidimensional array or a hypercube The actual physical storage my differ In our example cube has just two dimensions (supplier, part) The two dimensions are unequal (no square rectangle..) Means group by all possible subsets of the set {A, B,..., Z } CUBE Means group by all possible subsets of the set {A, B,..., Z } M={A, B,..., Z }, M =N Power Set (Algebra) P(M):={N N M}, P(M) =2 N..proof by induction Subset represent different grade of summarization Data Mining: such a subset is called a Cuboid 14

Cross Tabulations Display query results as cross tabulations More readable way Formatted as a simple array Example: two dimensions (supplier and parts) P1 Total S1 300 500 S2 300 400 700 S3 0 S4 0 600 1000 1600 What is a Data Cube? A data cube, such as sales, allows data to be modeled and viewed in multiple dimensions Dimension tables, such as item(item_name, brand, type) time(day, week, month, quarter, year)...hierarchy Fact table contains measures (numerical values, such as dollars_sold) and keys to each of the related dimension tables 15

2-D view of sales data according to dimensions time and item 3-D view of sales data according to dimensions time, item, location 16

3-D data cube representation 4-D view of sales data according to dimensions time, item, location,supplier 17

Cuboid Names in data warehousing literature: The n-d cuboid, which holds the lowest level of summarization, is called a base cuboid.. {{A},{B},..} 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 Cube: A Lattice of Cuboids...(Power Set) all time item location supplier 0-D(apex) cuboid 1-D cuboids time,item time,location item,location location,supplier time,supplier item,supplier 2-D cuboids time,location,supplier time,item,location time,item,supplier item,location,supplier time, item, location, supplier 2 4 =16 3-D cuboids 4-D(base) cuboid 18

Conceptual Modeling of Data Warehouses Modeling data warehouses: dimensions & measures instead of relational model Subject, facilitates on-line data analysis oriented Most popular model is the multidimensional model Most common modeling paradigm: Star schema Data warehouse contains a large central table (fact table) Contains the data without redundancy A set of dimension tables (each for each dimension) time Example of Star Schema time_key day day_of_the_week month quarter year branch branch_key branch_name branch_type Measures Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales item item_key item_name brand type supplier_type location location_key street city state_or_province country 19

Snowflake schema 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 time Example of Snowflake Schema time_key day day_of_the_week month quarter year branch branch_key branch_name branch_type Measures Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales item item_key item_name brand type supplier_key location location_key street city_key supplier supplier_key supplier_type city city_key city state_or_province country 20

Fact constellations Fact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation time time_key day day_of_the_week month quarter year branch branch_key branch_name branch_type Example of Fact Constellation Measures Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales item item_key item_name brand type supplier_type location location_key street city province_or_state country Shipping Fact Table time_key item_key shipper_key from_location to_location dollars_cost units_shipped shipper shipper_key shipper_name location_key shipper_type 21

Measures of Data Cube: Three Categories (Depending on the aggregate functions) 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() Hierarchies Independent variables are often related in hierarchies (taxonomy) Determine ways in which dependent data can be aggregated Temporal hierarchy Seconds, minutes, hours, days, weeks, months, years Same data can be aggregated in many different ways Same independent variable can belong to different hierarchies 22

all Hierarchy - Location all region Europe... North_America country Germany... Spain Canada... Mexico city Frankfurt... Vancouver... Toronto office L. Chan... M. Wind View of Warehouses and Hierarchies Specification of hierarchies Schema hierarchy day < {month < quarter; week} < year Set_grouping hierarchy {1..10} < inexpensive 23

Multidimensional Data Sales volume as a function of product, month, and region Region Dimensions: Product, Location, Time Hierarchical summarization paths Product Industry Region Year Category Country Quarter Product City Month Week Month Office Day Drill up and down Drill up: going from a lower level of aggregation to a higher Drill down: means the opposite Possible difference between drill up and roll up Roll up: creating the desired groupings or aggregations Drill up: accessing the aggregations Example for drill down: Given the total shipment quantity, get the total quantities for each individual supplier 24

A Star-Net Query Model Al l AIR-EXPRESS Shipping Method All Customer Orders CONTRACTS All Customer Time Al l TRUCK ANNUALY QTRLY DAILY CITY COUNTRY ORDER Product PRODUCT LINE Al PRODUCT ITEM l PRODUCT GROUP SALES PERSON DISTRICT REGION Al l Location Promotion Al l Organization DIVISION Al l Typical OLAP Operations Roll up (drill-up): summarize data by climbing up hierarchy or by dimension reduction Drill down (roll down): reverse of roll-up from higher level summary to lower level summary or detailed data, or introducing new dimensions Slice and dice: project and select Pivot (rotate): reorient the cube, visualization, 3D to series of 2D planes Other operations 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) 25

Fig. 3.10 Typical OLAP Operations Multi-dimensional query Language No standard yet.. DMQL, DMX,.. MDX was introduced by Microsoft with Microsoft SQL Server OLAP Services in around 1998, as the language component of the OLE DB for OLAP API. More recently, MDX has appeared as part of the XML for Analysis API. Microsoft proposed that the MDX is a standard, and its adoption among application writers and other OLAP providers is steadily increasing. 26

Data Warehouse: A Multi-Tiered Architecture Other sources Metadata Monitor & Integrator OLAP Server Operational DBs Extract Transform Load Refresh Data Warehouse Serve Analysis Query Reports Data mining Data Marts Data Sources Data Storage OLAP Engine Front-End Tools OLAP Server Architectures Relational OLAP (ROLAP) Use relational or extended-relational DBMS to store and manage warehouse data and OLAP middle ware Include optimization of DBMS backend, implementation of aggregation navigation logic, and additional tools and services Greater scalability Multidimensional OLAP (MOLAP) Sparse array-based multidimensional storage engine Fast indexing to pre-computed summarized data Hybrid OLAP (HOLAP) (e.g., Microsoft SQLServer) Flexibility, e.g., low level: relational, high-level: array Specialized SQL servers (e.g., Redbricks) Specialized support for SQL queries over star/snowflake schemas 27

MOLAP Multidimensional database (server) Data is stored in cells of a multi-dimensional array Three dimensions: products, customers, time intervals Each individual cell value might then represent the total quantity of the indicated product sold to the indicated customer in the indicated time interval Variable dependent or independent Independent: products, customers, time intervals Dependent: quantity Independent, dependent Independent variables form the dimension of the array by which the data is organized addressing scheme of the array Also named: dimensional, location Dependent variable values stored in the cells of the array Also named: nondimensional, content 28

Problems Often we do not know which variables are independent and which dependent Chosen based on hypothesis, and then tested A lot of iteration of trail and error Pivoting: Swapping between dimensional and nondimensional variables Array transpose, dimensional reordering, add dimensions MOLAP Array cells often empty The more dimensions, there more empty cells Empty cell Missing information How to treat not present information? How does the system support Information is unknown Has been not captured Not applicable... Arrays are sparse Support techniques to store sparse arrays 29

HOLAP (hybrid OLAP) HOLAP, combine ROLAP and MOLAP Controversy: which approach is the best? MOLAP provides faster computation but supports smaller amount of data than ROLAP ROLAP provide scalability, SQL standard has been extended International Organization for Standardization (ISO): SQL/OLAP, Document ISO/ICE 9075-1:1999/Amd.1:0(E) Summary: Data Warehouse and OLAP Technology Why data warehousing? A multi-dimensional model of a data warehouse Star schema, snowflake schema, fact constellations A data cube OLAP operations: drilling, rolling, slicing, dicing and pivoting OLAP servers: ROLAP, MOLAP, HOLAP 30

Implementation & Computation of DW and Data Cube 31