Data Warehousing & OLAP

Slides:



Advertisements
Similar presentations
April 30, Data Warehousing and OLAP Technology: An Overview  What is a data warehouse?  Data warehouse architecture  From data warehousing to.
Advertisements

Data Warehousing.
Introduction to Data Warehousing CPS Notes 6.
Advanced Querying OLAP Data Warehousing. Database Applications Transaction processing –Online setting –Supports day-to-day operation of business Decision.
ICS 421 Spring 2010 Data Warehousing 2 Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/30/20101Lipyeow.
ICS 421 Spring 2010 Data Warehousing (1) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/18/20101Lipyeow.
The Role of Data Warehousing and OLAP Technologies CS 536 – Data Mining These slides are adapted from J. Han and M. Kamber’s book slides (
1 CIS *717.2 Data Warehouse Design Week 2 Dimensional Modeling Primer Data Warehouse Models OLAP Operations Instructor Carmela R. Balassiano Feb 5, Spring.
Data Warehouses and OLAP
Data Warehousing Xintao Wu. Evolution of Database Technology (See Fig. 1.1) 1960s: Data collection, database creation, IMS and network DBMS 1970s: Relational.
Data Warehousing.
Dr. M. Sulaiman Khan Dept. of Computer Science University of Liverpool 2010 COMP207: Data Mining Data Warehousing COMP207: Data Mining.
1 Lecture 10: More OLAP - Dimensional modeling
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/ Data Warehouse and Data Cube Lecture Notes for Chapter 3 Introduction to Data Mining By.
Business Systems Intelligence: 3. Data Warehousing Dr. Brian Mac Namee (
CSE6011 Warehouse Models & Operators  Data Models  relations  stars & snowflakes  cubes  Operators  slice & dice  roll-up, drill down  pivoting.
Ch3 Data Warehouse part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009.
1 Data Warehousing and OLAP. 2 Data Warehousing & OLAP Defined in many different ways, but not rigorously.  A decision support database that is maintained.
Tanvi Madgavkar CSE 7330 FALL Ralph Kimball states that : A data warehouse is a copy of transaction data specifically structured for query and analysis.
Ch3 Data Warehouse Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why.
Dr. Bernard Chen Ph.D. University of Central Arkansas
8/20/ Data Warehousing and OLAP. 2 Data Warehousing & OLAP Defined in many different ways, but not rigorously. Defined in many different ways, but.
CIS664-Knowledge Discovery and Data Mining
8/25/2015Data Mining: Concepts and Techniques 1 Data Mining: Concepts and Techniques — Chapter 3 — Jiawei Han Department of Computer Science University.
August 25, 2015Data Mining: Concepts and Techniques 1 Data Warehousing What is a data warehouse? A multi-dimensional data model Data warehouse architecture.
Data Warehousing and Decision Support courtesy of Jiawei Han, Larry Kerschberg, and etc. for some slides. Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY.
An overview of Data Warehousing and OLAP Technology
August 25, 2015Data Mining: Concepts and Techniques 1 Data Mining: Concepts and Techniques — Chapter 3 —
School of Management, HUST
Data warehouses and Online Analytical Processing.
Introduction to Data Mining and Data Warehousing Muhammad Ali Yousuf DSC – ITM Friday, 9 th May 2003.
October 6, 2015Data Mining: Concepts and Techniques 1 Chapter 3: Data Warehousing and OLAP Technology: An Overview What is a data warehouse? A multi-dimensional.
Data Warehousing Xintao Wu. Can You Easily Answer These Questions? What are Personnel Services costs across all departments for all funding sources? What.
1 Fall 2004, CIS, Temple University CIS527: Data Warehousing, Filtering, and Mining Lecture 2 Data Warehousing and OLAP Technology for Data Mining Lecture.
OLAP & DSS SUPPORT IN DATA WAREHOUSE By - Pooja Sinha Kaushalya Bakde.
Roadmap 1.What is the data warehouse, data mart 2.Multi-dimensional data modeling 3.Data warehouse design – schemas, indices 4.The Data Cube operator –
October 28, Data Warehouse Architecture Data Sources Operational DBs other sources Analysis Query Reports Data mining Front-End Tools OLAP Engine.
Knowledge Discovery and Data Mining Vasileios Megalooikonomou Dept. of Computer and Information Sciences Temple University Data Warehousing and OLAP Technology.
Dr. N. MamoulisAdvanced Database Technologies1 Topic 6: Data Warehousing & OLAP Defined in many different ways, but not rigorously. A decision support.
Ch3 Data Warehouse Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009.
Data Mining Data Warehouses.
Managing Data for DSS II. Managing Data for DS Data Warehouse Common characteristics : –Database designed to meet analytical tasks comprising of data.
M. Sulaiman Khan Dept. of Computer Science University of Liverpool 2009 This is the full course notes, but not quite complete. You.
2016年1月21日星期四 2016年1月21日星期四 2016年1月21日星期四 Data Mining: Concepts and Techniques 1 Data Mining: Concepts and Techniques — Chapter 3 — Jiawei Han Department.
January 21, 2016Data Mining: Concepts and Techniques 1 Chapter 3: Data Warehousing and OLAP Technology: An Overview What is a data warehouse? A multi-dimensional.
Datawarehousing and OLAP C.Eng 714 Spring
CPT-S Advanced Databases 1 Yinghui Wu EME 49 ADB (ln27)
June 12, 2016Data Mining: Concepts and Techniques 1 Data Mining: Concepts and Techniques — Chapter 3 — Jiawei Han Department of Computer Science University.
Data Warehouses and OLAP. Data Warehousing and OLAP Technology for Data Mining  What is a data warehouse?  A multi-dimensional data model  Data warehouse.
1 Chapter 4: Data Warehousing and On-line Analytical Processing Data Warehouse: Basic Concepts Data Warehouse Modeling: Data Cube and OLAP Data Warehouse.
Data Mining and Data Warehousing: Concepts and Techniques What is a Data Warehouse? Data Warehouse vs. other systems, OLTP vs. OLAP Conceptual Modeling.
Data Mining: Data Warehousing
Introduction to Data Warehousing
Information Management course
Data Warehousing CIS 4301 Lecture Notes 4/20/2006.
Data warehouse and OLAP
A multi-dimensional data model
Data Mining: Concepts and Techniques (3rd ed.) — Chapter 4 —
Information Management course
Data Warehouse—Subject‐Oriented
OLAP Concepts and Techniques
Data Warehousing and OLAP Technology for Data Mining
Chapter 2: Data Warehousing and OLAP Technology for Data Mining
Lecture 4: From Data Cubes to ML
Overview of Data Warehousing and OLAP
Data Warehousing and Decision Support Chapter 25
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009
Data Mining: Concepts and Techniques
Presentation transcript:

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, 2004

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

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— 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

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

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 real-time

OLAP Data is perceived and manipulated as though it were stored in a „multi-dimensional 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

Queries for supplier-and-parts database Get the total shipment quantity Get total shipment quantities by supplier Get total shipment quantities by part Get the shipment by supplier and part

SP S# P# QTY S1 P1 300 P2 200 S2 400 S3 S4

1. SELECT SUM(QTY) AS TOTQTY FROM SP GROUP BY () ; TOTQTY 1600

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

3. SELECT P#, SUM(QTY) AS TOTQTY FROM SP GROUP BY (P#) ; P# TOTQTY P1 600 P2 1000

4. SELECT S#, P#, SUM(QTY) AS TOTQTY FROM SP GROUP BY (S#,P#) , S# P# TOTQTY S1 P1 300 P2 200 S2 400 S3 S4

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#) ) ; Single results table Not a relation !! null  missing information S# P# TOTQTY S1 null 500 S2 700 S3 200 S4 P1 600 P2 1000

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

ROLLUP S# P# TOTQTY S1 P1 300 P2 200 S2 400 S3 S4 null 500 700 1600 SELECT S#,P#, SUM ( QTY ) AS TOTQTY FROM SP GROUP BY ROLLUP (S#, P#) ; GROUP BY GROUPING SETS ( ( S#, P# ), ( S# ) , ( ) )

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# P# TOTQTY S1 P1 300 P2 200 S2 400 S3 S4 null 500 700 600 1000 1600 CUBE SELECT S#, P#, SUM ( QTY ) AS TOTQTY FROM SP GROUP BY CUBE ( S#, P#) ; GROUP BY GROUPING SETS ( (S#, P#), ( S# ), ( P# ), ( ) )

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)|=2N ..proof by induction Subset represent different grade of summarization Data Mining: such a subset is called a Cuboid

Cross Tabulations Display query results as cross tabulations More readable way Formatted as a simple array Example: two dimensions (supplier and parts) P1 P2 Total S1 300 200 500 S2 400 700 S3 S4 600 1000 1600

What is a Data Cube? Data Mining definition 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

Cuboid (Data Mining Definition) 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 time,location time,supplier item,location item,supplier location,supplier time,item,supplier time,location,supplier item,location,supplier 0-D(apex) cuboid 1-D cuboids 2-D cuboids 3-D cuboids 4-D(base) cuboid time,item time,item,location time, item, location, supplier 24=16

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)

Example of Star Schema item branch time Sales Fact Table time_key day day_of_the_week month quarter year time item_key item_name brand type supplier_type item Sales Fact Table time_key item_key branch_key branch_key branch_name branch_type branch location_key street city state_or_province country location location_key units_sold dollars_sold avg_sales Measures

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

Example of Snowflake Schema time_key day day_of_the_week month quarter year time item_key item_name brand type supplier_key item supplier_key supplier_type supplier Sales Fact Table time_key item_key branch_key location_key street city_key location branch_key branch_name branch_type branch location_key units_sold city_key city state_or_province country dollars_sold avg_sales Measures

Fact constellations Fact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation

Example of Fact Constellation time_key day day_of_the_week month quarter year time item_key item_name brand type supplier_type item Shipping Fact Table Sales Fact Table time_key item_key time_key shipper_key item_key from_location branch_key branch_key branch_name branch_type branch location_key to_location location_key street city province_or_state country location dollars_cost units_sold units_shipped dollars_sold avg_sales shipper_key shipper_name location_key shipper_type shipper Measures

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

Hierarchy - Location all all Europe ... North_America region Germany Spain Canada ... Mexico country Vancouver ... city Frankfurt ... Toronto L. Chan ... M. Wind office

View of Warehouses and Hierarchies Specification of hierarchies Schema hierarchy day < {month < quarter; week} < year Set_grouping hierarchy {1..10} < inexpensive

Multidimensional Data Sales volume as a function of product, month, and region Dimensions: Product, Location, Time Hierarchical summarization paths Region Industry Region Year Category Country Quarter Product City Month Week Office Day Product Month

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()

Drill up and down Drill up: Drill down: going from a lower level of aggregation to a higher Drill down: means the opposite 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

A Sample Data Cube All, All, All Date Product Country Total annual sales of TV in Portugal Date Product Country All, All, All sum TV VCR PC 1Qtr 2Qtr 3Qtr 4Qtr Portugal Spain Germany

Browsing a Data Cube Visualization OLAP capabilities Interactive manipulation

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)

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. No normalization theory that could serve as a scientific basis for designing multi-dimensional databases

What is ROLAP, MOLAP, HOLAP? OLAP data stored in a conventional relational database (server) Mondrian (open-source) Mondrian is an OLAP server written in Java. It enables you to interactively analyze very large datasets stored in SQL databases without writing SQL. http://mondrian.sourceforge.net/index.html

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

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

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:2000(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 consists of dimensions & measures OLAP operations: drilling, rolling, slicing, dicing and pivoting OLAP servers: ROLAP, MOLAP, HOLAP

Implementation & Computation of DW and Data Cube