DATA CUBES E0 261 Jayant Haritsa Computer Science and Automation

Slides:



Advertisements
Similar presentations
Relational On-Line Analytical Processing (ROLAP)
Advertisements

An overview of Data Warehousing and OLAP Technology Presented By Manish Desai.
12/18/20141 PSU’s CS Data Warehouses and Decision Support Len Shapiro, for CS386, 11/2-3/05. Some slides taken from Ramakrishnan and Gherke,
Data Warehousing and Decision Support, part 2
OLAP Tuning. Outline OLAP 101 – Data warehouse architecture – ROLAP, MOLAP and HOLAP Data Cube – Star Schema and operations – The CUBE operator – Tuning.
Outline What is a data warehouse? A multi-dimensional data model Data warehouse architecture Data warehouse implementation Further development of data.
Data Warehousing CPS216 Notes 13 Shivnath Babu. 2 Warehousing l Growing industry: $8 billion way back in 1998 l Range from desktop to huge: u Walmart:
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 391 Database Systems I Data Warehousing.
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.
1 OLAP and Decision Support Chapter 25, Part A. 2 Introduction  Increasingly, organizations are analyzing current and historical data to identify useful.
Advanced Querying OLAP Part 2. Context OLAP systems for supporting decision making. Components: –Dimensions with hierarchies, –Measures, –Aggregation.
CS 286, UC Berkeley, Spring 2007, R. Ramakrishnan 1 Decision Support Chapter 25.
COMP 578 Data Warehousing And OLAP Technology Keith C.C. Chan Department of Computing The Hong Kong Polytechnic University.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support Chapter 25, Part A.
Lab3 CPIT 440 Data Mining and Warehouse.
Data Warehousing. On-Line Analytical Processing (OLAP) Tools The use of a set of graphical tools that provides users with multidimensional views of their.
CSE6011 Warehouse Models & Operators  Data Models  relations  stars & snowflakes  cubes  Operators  slice & dice  roll-up, drill down  pivoting.
Chapter 13 The Data Warehouse
CS346: Advanced Databases
8/20/ Data Warehousing and OLAP. 2 Data Warehousing & OLAP Defined in many different ways, but not rigorously. Defined in many different ways, but.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Decision Support Chapter 23.
CPSC 404, Laks V.S. Lakshmanan 1 Data Warehousing & OLAP Chapter 25, Ramakrishnan & Gehrke (Sections )
 Data warehouses  Decision support  The multidimensional model  OLAP queries.
Week 6 Lecture The Data Warehouse Samuel Conn, Asst. Professor
Data Warehouse & Data Mining
Multi-Dimensional Databases & Online Analytical Processing This presentation uses some materials from: “ An Introduction to Multidimensional Database Technology,
Database Systems I Data Warehousing I NTRODUCTION Increasingly, organizations are analyzing current and historical data to identify useful patterns.
1 Data Warehouses BUAD/American University Data Warehouses.
OLAP & DSS SUPPORT IN DATA WAREHOUSE By - Pooja Sinha Kaushalya Bakde.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Decision Support Chapter 23.
Data Warehouse & OLAP Kuliah 1 Introduction Slide banyak mengambil dari acuan- acuan yang dipakai.
Data Warehousing.
October 28, Data Warehouse Architecture Data Sources Operational DBs other sources Analysis Query Reports Data mining Front-End Tools OLAP Engine.
Decision Support and Date Warehouse Jingyi Lu. Outline Decision Support System OLAP vs. OLTP What is Date Warehouse? Dimensional Modeling Extract, Transform,
Ch3 Data Warehouse Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009.
1 On-Line Analytic Processing Warehousing Data Cubes.
Data Warehousing Multidimensional Analysis
OLAP & Data Warehousing. R. Ramakrishnan and J. Gehrke1 Decision Support Chapter 23.
CSE 5331/7331 F'071 CSE 5331/7331 Fall 2007 Dimensional Modeling Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University.
Data Warehousing.
Advanced Database Concepts
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support Chapter 25.
Introduction to OLAP and Data Warehouse Assoc. Professor Bela Stantic September 2014 Database Systems.
An Overview of Data Warehousing and OLAP Technology
Data Warehouses and OLAP 1.  Review Questions ◦ Question 1: OLAP ◦ Question 2: Data Warehouses ◦ Question 3: Various Terms and Definitions ◦ Question.
Data Warehousing and OLAP Outline u Models & operations u Implementing a warehouse u Future directions.
Data Analysis Decision Support Systems Data Analysis and OLAP Data Warehousing.
11/20/ :11 AMData Mining 1 Data Mining – CSE 9033 Chapter – 1; Data Warehousing Dr. Goutam Sarker, B.E., M.E., Ph.D.(Engineering), Fellow: IE(I),
Overview of Data Warehousing and OLAP
Data Mining: Data Warehousing
Pertemuan <<13>> Data Warehousing dan Decision Support
Data Warehousing CIS 4301 Lecture Notes 4/20/2006.
Chapter 13 Business Intelligence and Data Warehouses
On-Line Analytic Processing
Data warehouse and OLAP
Chapter 13 The Data Warehouse
Data storage is growing Future Prediction through historical data
OLAP Concepts and Techniques
Data Warehouse.
On-Line Analytical Processing (OLAP)
Data Warehouse and OLAP
Data Warehousing: Data Models and OLAP operations
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009
Introduction of Week 9 Return assignment 5-2
Data Warehouse.
Slides based on those originally by : Parminder Jeet Kaur
Data Warehouse and OLAP
Presentation transcript:

DATA CUBES E0 261 Jayant Haritsa Computer Science and Automation Indian Institute of Science

Introduction Increasingly, organizations are analyzing historical data to identify useful patterns and support business strategies. Emphasis is on complex, interactive, exploratory analysis of very large datasets created by integrating data from across all parts of an enterprise; data is fairly static. Contrast such On-Line Analytic Processing (OLAP) with traditional On-line Transaction Processing (OLTP): mostly long queries, instead of short update Xacts.

Overview Data Warehousing: Consolidate data from many sources in one large repository Loading, periodic synchronization of replicas. Semantic integration. OLAP: Complex SQL queries and views. Queries based on spreadsheet-style operations and “multidimensional” view of data. Interactive and “online” queries. Note that Data Warehouses form the substrate on which Data Mining can be carried out.

Data Warehousing EXTERNAL DATA SOURCES Integrated data spanning long time periods, often augmented with summary information. Several terabytes to petabytes common. Interactive response times expected for complex queries; ad-hoc updates uncommon. EXTRACT TRANSFORM LOAD REFRESH DATA WAREHOUSE Metadata Repository SUPPORTS OLAP Mining

Warehousing Issues Semantic Integration: When getting data from multiple sources, must eliminate mismatches, e.g., different currencies, schemas. Heterogeneous Sources: Must access data from a variety of source formats and repositories. Load, Refresh, Purge: Must load data, periodically refresh it, and purge too-old data. Metadata Management: Must keep track of source, loading time, and other information for all data in the warehouse.

Multidimensional Data Model timeid locid sales pid Collection of numeric measures, which depend on a set of dimensions. E.g., measure Sales, dimensions Product (pid), Location (locid), and Time (timeid). 8 10 10 30 20 50 25 8 15 1 2 3 timeid 11 12 13 pid Slice locid=1 is shown: locid

MOLAP vs ROLAP Multidimensional data can be stored physically in a (disk-resident, persistent) array; called MOLAP systems (covered in TIDS course) Essbase Alternatively, can store as a relation; called ROLAP systems (today’s paper) Redbrick, Oracle

ROLAP Tables The main relation, which relates dimensions to a measure, is called the fact table. Example: SALES(pid, timeid, locid, sales) Each dimension can have additional attributes and an associated dimension table. Example: Products(pid, pname, category, price) Fact tables are much larger than dimensional tables. Their schema is {foreign keys of all dimension tables + all measure attributes}

Dimension Hierarchies For each dimension, the set of values can be organized in a hierarchy: PRODUCT TIME LOCATION year quarter country category week month state pname date city

OLAP Queries Influenced by SQL and by spreadsheets. A common operation is to aggregate a measure over one or more dimensions. Find total sales. Find total sales for each city, or for each state. Find top five products ranked by total sales. Roll-up: Aggregating at different levels of a dimension hierarchy. E.g., Given total sales by city, we can roll-up to get sales by state.

OLAP Queries (contd) Drill-down: The inverse of roll-up. E.g., Given total sales by state, can drill-down to get total sales by city. E.g., Can also drill-down on different dimension to get total sales by product for each state. Pivoting: Aggregation on selected dimensions. E.g., Pivoting on Location and Time yields this cross-tabulation: equivalent to “rotation” WB UP Total 63 81 144 1995 1996 38 107 145 1997 75 35 110 176 223 339 Total

OLAP Queries (contd) Slicing : Equality selections on one or more dimensions. Dicing: Range selections on one or more dimensions.

Comparison with SQL Queries The cross-tabulation obtained by pivoting can also be computed using a collection of SQL queries: SELECT SUM(S.sales) FROM Sales S, Times T, Locations L WHERE S.timeid=T.timeid AND S.locid=L.locid GROUP BY T.year, L.state SELECT SUM(S.sales) FROM Sales S, Times T WHERE S.timeid=T.timeid GROUP BY T.year SELECT SUM(S.sales) FROM Sales S, Location L WHERE S.locid=L.locid GROUP BY L.state

3-D CUBE Model

The CUBE Operator Generalizing the previous example, if there are k dimensions, we have 2k possible SQL GROUP BY queries that can be generated through pivoting on a subset of dimensions. CUBE pid, locid, timeid BY SUM Sales Equivalent to rolling up Sales on all eight subsets of the set {pid, locid, timeid}; each roll-up corresponds to an SQL query of the form: SELECT SUM(S.sales) FROM Sales S GROUP BY grouping-list Lots of work on optimizing the CUBE operator!

CUBE TABLES Use “ALL” to represent the set over which aggregation is computed (Fig 4)

Cube Operator (contd) Devised by Jim Gray et al Jim Gray, a key architect of System R IBM Almaden for several years, then with Tandem, then Digital, then Microsoft Very practical orientation Received Turing award in 1999 ! Went missing on a boat trip off California coast in January 2007, no trace found 

Aggregation Hierarchy GROUP BY <select list 3> ROLLUP <select list 2> CUBE <select list 1> SELECT manufacturer, year, month, day, color, model, SUM (price) as revenue FROM Sales GROUP BY Manufacturer ROLLUP Year(Time) as Year, Month(Time) as Month, Day(Time) as Day, CUBE Color, Model Insert example from paper compare the two alternatives (Chris Date + Crosstab) Include ALL

Figure 5 Manufacturer Year, Month , Day Model xColor Cubes

CUBE Research Issues Storage Structures for Cubes (ROLAP, MOLAP) Schemas for ROLAP Cube (Star, Snowflake) Index Structures for Cubes Level of Materialization of Cube (next paper) ....

CUBE SCHEMAS

Star Schema (Fact table) TIMES timeid date week month quarter year holiday_flag (Fact table) pid timeid locid sales SALES PRODUCTS LOCATIONS pid pname category price locid city state country Fact table in BCNF; dimension tables not normalized. Dimension tables are small; updates/inserts/deletes are rare. So, anomalies less important than good query performance. Computing the join of all these relations is called a star join.

Snowflake Schema TIMES Dimension tables are also normalized to reduce redundancy. timeid date week month quarter year holiday_flag (Fact table) pid timeid locid sales SALES PRODUCTS LOCATIONS mfr pid pname category price locid city state country MANUFACTURER mfr name location stockprice

CUBE INDEXES

Indexes Joins are common between fact table and dimension tables Interactive response is expected, so indexes are required. Problems: Space maintenance is not a problem because read-only data

Join Indexes Consider the join of Sales, Products, Times, and Locations, possibly with additional selection conditions (e.g., country=“India”). A join index can be constructed to speed up such joins. The index contains [p,t,l,s] if there are tuples p in Products, t in Times and l in Locations that satisfy the join (with sid) s in Sales . E.g. [Beer,March 9, Malleswaram, {2567,3089,156323}] Problem: Number of join indexes can grow rapidly. A variant of the idea addresses this problem: For each column with an additional selection (e.g., country), build an index with [c,s] in it if a dimension table tuple with value c in the selection column joins with a Sales tuple with sid s; if indexes are bitmaps, called bitmapped join index.

Bitmapped Join Index (Fact table) TIMES timeid date week month quarter year holiday_flag (Fact table) pid timeid locid sales SALES PRODUCTS LOCATIONS pid pname category price locid city state country Consider a query with conditions price=10 and country=“India”. Suppose tuple (with sid) s in Sales joins with a tuple p with price=10 and a tuple l with country =“India”. There are two join indexes; one containing [10,s] and the other [India,s]. Intersecting these indexes tells us which tuples in Sales are in the join and satisfy the given selection.

Summary Decision support is an emerging, rapidly growing subarea of databases. Involves the creation of large, consolidated data repositories called data warehouses. Warehouses exploited using sophisticated analysis techniques: complex SQL queries and OLAP “multidimensional” queries (influenced by both SQL and spreadsheets). New techniques for database design, indexing, view maintenance, and interactive querying need to be supported.

END DATA CUBES E0 261