OLAP. Overview Traditional database systems are tuned to many, small, simple queries. Some new applications use fewer, more time-consuming, analytic queries.

Slides:



Advertisements
Similar presentations
OLAP Tuning. Outline OLAP 101 – Data warehouse architecture – ROLAP, MOLAP and HOLAP Data Cube – Star Schema and operations – The CUBE operator – Tuning.
Advertisements

Copyright © Starsoft Inc, Data Warehouse Architecture By Slavko Stemberger.
Data Analysis. Overview Traditional database systems are tuned to many, small, simple queries. Some applications use fewer, more time-consuming, analytic.
Online Analytical Processing OLAP
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:
OLAP Services Business Intelligence Solutions. Agenda Definition of OLAP Types of OLAP Definition of Cube Definition of DMR Differences between Cube and.
Jennifer Widom On-Line Analytical Processing (OLAP) Introduction.
2/10/05Salman Azhar: Database Systems1 On-Line Analytical Processing Salman Azhar Warehousing Data Cubes Data Mining These slides use some figures, definitions,
Decision Support and Data Warehouse. Decision supports Systems Components Data management function –Data warehouse Model management function –Analytical.
Lecture 1: Data Warehousing Based on the slides by Jeffrey D. Ullman and Hector Garcia-Molina at Stanford University 1.
Advanced Querying OLAP Part 2. Context OLAP systems for supporting decision making. Components: –Dimensions with hierarchies, –Measures, –Aggregation.
1 On-Line Application Processing Warehousing Data Cubes Data Mining.
COMP 578 Data Warehousing And OLAP Technology Keith C.C. Chan Department of Computing The Hong Kong Polytechnic University.
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
On-Line Application Processing Warehousing Data Cubes Data Mining 1.
Online Analytical Processing (OLAP) Hweichao Lu CS157B-02 Spring 2007.
Garcia-Molina, Ullman, and Widom Chapter 10 Part 2.
© 2014 Zvi M. Kedem 1 Unit 11 Online Analytical Processing (OLAP) Basic Concepts.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Decision Support Chapter 23.
Week 6 Lecture The Data Warehouse Samuel Conn, Asst. Professor
On-Line Analytic Processing Chetan Meshram Class Id:221.
OnLine Analytical Processing (OLAP)
20.5 Data Cubes Instructor : Dr. T.Y. Lin Chandrika Satyavolu 222.
1 On-Line Application Processing Warehousing Data Cubes Data Mining.
DIMENSIONAL MODELLING. Overview Clearly understand how the requirements definition determines data design Introduce dimensional modeling and contrast.
1 Data Warehouses BUAD/American University Data Warehouses.
Data Warehousing.
BI Terminologies.
BUSINESS ANALYTICS AND DATA VISUALIZATION
Ch3 Data Warehouse Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009.
Winter 2006Winter 2002 Keller, Ullman, CushingJudy Cushing 19–1 Warehousing The most common form of information integration: copy sources into a single.
Fox MIS Spring 2011 Data Warehouse Week 8 Introduction of Data Warehouse Multidimensional Analysis: OLAP.
UNIT-II Principles of dimensional modeling
1 On-Line Analytic Processing Warehousing Data Cubes.
On-Line Application Processing Warehousing Data Cubes (Data Mining) (slides borrowed from Stanford)
ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi.
Data Warehousing Multidimensional Analysis
Business Intelligence Transparencies 1. ©Pearson Education 2009 Objectives What business intelligence (BI) represents. The technologies associated with.
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.
Summarization – CS 257 Chapter – 21 Database Systems: The Complete Book Submitted by: Nitin Mathur Submitted to: Dr.T.Y.Lin.
INFORMATION INTEGRATION Sandeep Singh Balouria CS-257 ID- 101.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support.
SF-Tree and Its Application to OLAP Speaker: Ho Wai Shing.
1 Introduction to Database Systems, CS420 SQL Views and Indexes.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Data Warehousing and Decision Support Chapter 25.
1 Database Systems, 8 th Edition Star Schema Data modeling technique –Maps multidimensional decision support data into relational database Creates.
Introduction to OLAP and Data Warehouse Assoc. Professor Bela Stantic September 2014 Database Systems.
An Overview of Data Warehousing and OLAP Technology
Chapter 111 Chapter 11 Information Integration Spring 2001 Prof. Sang Ho Lee School of Computing, Soongsil Univ.
Data Warehouses and OLAP 1.  Review Questions ◦ Question 1: OLAP ◦ Question 2: Data Warehouses ◦ Question 3: Various Terms and Definitions ◦ Question.
Pindaro Demertzoglou Data Resource Management – MGMT 4170 Lally School of Management Rensselaer Polytechnic Institute.
Databases 2 On-Line Application Processing: Warehousing, Data Cubes, Data Mining.
Data Warehousing and OLAP Outline u Models & operations u Implementing a warehouse u Future directions.
CSE6011 Implementing a Warehouse  Monitoring: Sending data from sources  Integrating: Loading, cleansing,...  Processing: Query processing, indexing,...
On-Line Application Processing
Data warehouse.
Chapter 11 Information Integration
Data Warehousing CIS 4301 Lecture Notes 4/20/2006.
Data Warehouse.
On-Line Analytic Processing
Data warehouse and OLAP
On-Line Analytic Processing
Chapter 13 The Data Warehouse
On-Line Analytical Processing (OLAP)
On-Line Application Processing
Online analytical processing (OLAP) is a category of software technology that enables analysts, managers, and executives to gain insight into data through.
Presentation transcript:

OLAP

Overview Traditional database systems are tuned to many, small, simple queries. Some new applications use fewer, more time-consuming, analytic queries. New architectures have been developed to handle analytic queries efficiently.

The Data Warehouse The most common form of data integration. –Copy sources into a single DB (warehouse) and try to keep it up-to-date. –Usual method: periodic reconstruction of the warehouse, perhaps overnight. –Frequently essential for analytic queries.

OLTP Most database operations involve On-Line Transaction Processing (OTLP). –Short, simple, frequent queries and/or modifications, each involving a small number of tuples. –Examples: Answering queries from a Web interface, sales at cash registers, selling airline tickets.

OLAP On-Line Analytical Processing (OLAP, or “analytic”) queries are, typically: –Few, but complex queries --- may run for hours. –Queries do not depend on having an absolutely up-to-date database.

Common Architecture Databases at store branches handle OLTP. Local store databases copied to a central warehouse overnight. Analysts use the warehouse for OLAP.

Star Schemas A star schema is a common organization for data at a warehouse. It consists of: 1.Fact table : a very large accumulation of facts such as sales. wOften “insert-only.” 2.Dimension tables : smaller, generally static information about the entities involved in the facts.

Example: Star Schema Suppose we want to record in a warehouse information about every car sale: the serial number, the date of sale, the dealer who sold the car, the day, the time, and the price charged. The fact table is a relation: Sales(serialNo, date, dealer, price)

Example -- Continued The dimension tables include information about the autos, dealers, and days “dimensions”: Autos(serialNo, model, color) Dealers(name, city, state) Days(day, week, month, year) (5, 27, 7, 2000) Day dimension table probably not stored.

Visualization – Star Schema Dimension Table (Day)Dimension Table (etc.) Dimension Table (Dealer)Dimension Table (Autos) Fact Table - Sales Dimension Attrs.Dependent Attrs.

Dimensions and Dependent Attributes Two classes of fact-table attributes: 1.Dimension attributes : the key of a dimension table. 2.Dependent attributes : a value determined by the dimension attributes of the tuple. price is the dependent attribute of our example Sales relation. It is determined by the combination of dimension attributes.

Approaches to Building Warehouses 1.ROLAP = “relational OLAP”: Tune a relational DBMS to support star schemas. 2.MOLAP = “multidimensional OLAP”: Use a specialized DBMS with a model such as the “data cube.”

Data Cubes Keys of dimension tables are the dimensions of a hypercube. –Example: for the Sales data, the three dimensions are serialNo, date, and dealer. Dependent attributes (e.g., price) appear at the points of the cube.

Visualization -- Data Cubes price dealer car date

Slicing and Dicing Slice –focus on particular partitions along (one or more) dimension i.e., focusing on a particular slice of the cube WHERE clause in SQL Dice –partitions the cube into smaller subcubes and the points in each subcube are aggregated GROUP BY clause in SQL

Slicing and Dicing in SQL SELECT grouping-attributes and aggregations FROM fact table joined with (zero or more) dimension tables WHERE certain attributes are compared with constants /* slicing */ GROUP BY grouping-attributes /* dicing */

Slicing and Dicing Example Suppose a particular car model, say ‘Gobi’, is not selling as well as anticipated. How to analyze? Maybe it’s the color… Slice for ‘Gobi.’ Dice for color. SELECT color, SUM(price) FROM Sales NATURAL JOIN Autos WHERE model = 'Gobi' GROUP BY color; Doesn’t show anything interesting.

Slicing and Dicing Example Suppose the previous query doesn't tell us much; each color produces about the same revenue. Since the query does not dice for time, we only see the total over all time for each color. –We may thus issue a revised query that also partitions time by month. SELECT color, month, SUM(price) FROM (Sales NATURAL JOIN Autos) JOIN Days ON date = day WHERE model = 'Gobi' GROUP BY color, month;

Slicing and Dicing Example We might discover that red Gobis havn’t sold well recently. Does this problem exists at all dealers, or only some dealers have had low sales of red Gobis? Let’s dice on dealer dimension as well. SELECT dealer, month, SUM(price) FROM (Sales NATURAL JOIN Autos) JOIN Days ON date = day WHERE model = 'Gobi' AND color = 'red‘ GROUP BY month, dealer;

Slicing and Dicing Example At this point, we find that the sales per month for red Gobis are so small that we cannot observe any trends easily. Thus, we decide that it was a mistake to dice by month. A better idea would be to partition only by years, and look at only the last two years (2006 and 2007). SELECT dealer, year, SUM(price) FROM (Sales NATURAL JOIN Autos) JOIN Days ON date = day WHERE model = 'Gobi' AND color = 'red' AND (year = 2001 OR year = 2002) GROUP BY year, dealer;

Drill-Down and Roll-Up Previous examples illustrate two common patterns in sequences of queries that slice-and-dice the data cube. Drill-down is the process of partitioning more finely and/or focusing on specific values in certain dimensions. –Each of the example steps except the last is an instance of drill-down. Roll-up is the process of partitioning more coarsely. –The last step, where we grouped by years instead of months to eliminate the effect of randomness in the data, is an example of roll-up.

Marginals The data cube also includes aggregation (typically SUM) along the margins of the cube. The marginals include aggregations over one dimension, two dimensions,…

Visualization --- Data Cube w/Aggregation price dealer car date SUM over all Days

Cube operator CUBE(F) is an augmented table for fact table F –tuples (or points) added in CUBE(F) have a value, denoted * to each dimension –* represents aggregation along that dimension

Example Sales(serialNo, date, dealer, price) Sales(model, color, date, dealer, val, cnt) serialNo dimension not well suited for the cube as summing the price over all dates, or over all dealers, but keeping the serial number fixed has no effect. We will replace the serial number by model and color to which the serial number connects. Also, we will have as independent attributes, val for sum of prices and cnt for number of cars sold.

Example: CUBE(Sale) ('Gobi', 'red', ' ', 'Friendly Fred', 45000, 2) –On May 21, 2001, dealer Friendly Fred sold two red Gobis for a total of $45,000. –Hypothetical tuple that would be in both Sales and CUBE(Sales). ('Gobi', *, ' ', 'Friendly Fred', , 7) –On May 21, 2001, Friendly Fred sold seven Gobis of all colors, for a total price of $152,000. –Note that this tuple is in CUBE(Sales) but not in Sales.

Example: CUBE(Sale) ('Gobi', *, ' ', *, , 100) –On May 21, 2001, there were 100 Gobis sold by all the dealers, and the total price of those Gobis was $2,348,000. ('Gobi', *, *, *, , 58000) –Over all time, dealers, and colors, 58,000 Gobis have been sold for a total price of $1,339,800,000. (*, *, *, *, , ) –Total sales of all models in all colors, over all time at all dealers is 198,000 cars for a total price of $3,521,727,000.

CUBE Helps Answering Queries SELECT color, AVG(price) FROM Sales WHERE model = 'Gobi' GROUP BY color; is answered by looking for all tuples of CUBE(Sales) with the form ('Gobi', c, *, *, v, n) where c is any specific color. v and n will be the sum and number of sales of Gobis in that color. The average price, is v/n. The answer to the query is the set of (c; v/n) pairs obtained from all ('Gobi', c, *, *, v, n) tuples.

CUBE in SQL SELECT model, color, date, dealer, SUM(val) AS v, SUM(cnt) AS n FROM Sales GROUP BY model, color, date, dealer WITH CUBE; Suppose we materialize this into SalesCube. Then the previous query is rewritten into: SELECT color, SUM(v)/SUM(n) FROM SalesCube WHERE model = 'Gobi' AND date IS NULL AND dealer IS NULL;