DW schema and the problem of views

Similar documents
Exam Datawarehousing INFOH419 July 2013

SQL Server Analysis Services

Dta Mining and Data Warehousing

Advanced Data Management Technologies

Improving the Performance of OLAP Queries Using Families of Statistics Trees

Tribhuvan University Institute of Science and Technology MODEL QUESTION

Decision Support Systems aka Analytical Systems

Novel Materialized View Selection in a Multidimensional Database

CS 1655 / Spring 2013! Secure Data Management and Web Applications

Data Warehousing & Mining. Data integration. OLTP versus OLAP. CPS 116 Introduction to Database Systems

Data Warehousing and Data Mining. Announcements (December 1) Data integration. CPS 116 Introduction to Database Systems

Basic operators: selection, projection, cross product, union, difference,

ETL and OLAP Systems

Lectures for the course: Data Warehousing and Data Mining (IT 60107)

Evolution of Database Systems

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 8 - Data Warehousing and Column Stores

Sql Fact Constellation Schema In Data Warehouse With Example

Relational Algebra Homework 0 Due Tonight, 5pm! R & G, Chapter 4 Room Swap for Tuesday Discussion Section Homework 1 will be posted Tomorrow

Basics of Dimensional Modeling

SQL Server 2005 Analysis Services

Data Mining Concepts & Techniques

Relational Model, Relational Algebra, and SQL

Overview. DW Performance Optimization. Aggregates. Aggregate Use Example

Relational Query Languages: Relational Algebra. Juliana Freire

Fig 1.2: Relationship between DW, ODS and OLTP Systems

Decision Support. Chapter 25. CS 286, UC Berkeley, Spring 2007, R. Ramakrishnan 1

Data Warehousing and Decision Support

Data Warehousing and Decision Support. Introduction. Three Complementary Trends. [R&G] Chapter 23, Part A

Data warehouse architecture consists of the following interconnected layers:

CS614 - Data Warehousing - Midterm Papers Solved MCQ(S) (1 TO 22 Lectures)

1 Dulcian, Inc., 2001 All rights reserved. Oracle9i Data Warehouse Review. Agenda

DATA WAREHOUSE EGCO321 DATABASE SYSTEMS KANAT POOLSAWASD DEPARTMENT OF COMPUTER ENGINEERING MAHIDOL UNIVERSITY

On-Line Application Processing

Announcements. Relational Model & Algebra. Example. Relational data model. Example. Schema versus instance. Lecture notes

Chapter 3. The Multidimensional Model: Basic Concepts. Introduction. The multidimensional model. The multidimensional model

Relational Database: The Relational Data Model; Operations on Database Relations

Data Warehousing and Decision Support

Advanced Data Management Technologies Written Exam

Contents Contents Introduction Basic Steps in Query Processing Introduction Transformation of Relational Expressions...

Query Processing & Optimization

1. Attempt any two of the following: 10 a. State and justify the characteristics of a Data Warehouse with suitable examples.

What s a database system? Review of Basic Database Concepts. Entity-relationship (E/R) diagram. Two important questions. Physical data independence

Proceedings of the IE 2014 International Conference AGILE DATA MODELS

Modern Database Systems CS-E4610

Constructing Object Oriented Class for extracting and using data from data cube

QUALITY MONITORING AND

BUSINESS INTELLIGENCE AND OLAP

Call: SAS BI Course Content:35-40hours

Data Warehouse and Data Mining

OLAP Introduction and Overview

Chapter 6. Foundations of Business Intelligence: Databases and Information Management VIDEO CASES

Data Warehouses. Yanlei Diao. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Management Information Systems MANAGING THE DIGITAL FIRM, 12 TH EDITION FOUNDATIONS OF BUSINESS INTELLIGENCE: DATABASES AND INFORMATION MANAGEMENT

Unit Assessment Guide

Chapter 2: Intro to Relational Model

CMP-3440 Database Systems

CHAPTER 8 DECISION SUPPORT V2 ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI

Data Warehousing ETL. Esteban Zimányi Slides by Toon Calders

Data Warehouses for Decision Support

Data Warehousing Conclusion. Esteban Zimányi Slides by Toon Calders

Database Management Systems MIT Lesson 01 - Introduction By S. Sabraz Nawaz

Relational Algebra for sets Introduction to relational algebra for bags

A Star Schema Has One To Many Relationship Between A Dimension And Fact Table

CMPT 354 Views and Indexes. Spring 2012 Instructor: Hassan Khosravi

Relational Model and Relational Algebra

An Overview of Data Warehousing and OLAP Technology

DW Performance Optimization (II)

CSE 544 Principles of Database Management Systems. Fall 2016 Lecture 14 - Data Warehousing and Column Stores

MIT Database Management Systems Lesson 01: Introduction

CSIT5300: Advanced Database Systems

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #2: The Relational Model and Relational Algebra

Summary of Last Chapter. Course Content. Chapter 2 Objectives. Data Warehouse and OLAP Outline. Incentive for a Data Warehouse

Optimization Overview

CSEN 501 CSEN501 - Databases I

Introduction to Data Management. Lecture #11 (Relational Algebra)

After completing this course, participants will be able to:

8) A top-to-bottom relationship among the items in a database is established by a

Warehousing. Data Mining

Relational Algebra. Lecture 4A Kathleen Durant Northeastern University

Chapter 1: Introduction

CIS 330: Applied Database Systems. ER to Relational Relational Algebra

Oracle BI 11g R1: Build Repositories

Deccansoft Software Services Microsoft Silver Learning Partner. SSAS Syllabus

Database Management Systems MIT Introduction By S. Sabraz Nawaz

Overview. Introduction to Data Warehousing and Business Intelligence. BI Is Important. What is Business Intelligence (BI)?

Web Science & Technologies University of Koblenz Landau, Germany. Relational Data Model

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

4. SQL - the Relational Database Language Standard 4.3 Data Manipulation Language (DML)

Data Warehousing & Data Mining

KNGX NOTES INFS1603 [INFS1603] KEVIN NGUYEN

OLAP2 outline. Multi Dimensional Data Model. A Sample Data Cube

Databases - Relational Algebra. (GF Royle, N Spadaccini ) Databases - Relational Algebra 1 / 24

Chapter 13: Query Processing

Outline. Quick Introduction to Database Systems. Data Manipulation Tasks. What do they all have in common? CSE142 Wi03 G-1

This lecture. Projection. Relational Algebra. Suppose we have a relation

ALTERNATE SCHEMA DIAGRAMMING METHODS DECISION SUPPORT SYSTEMS. CS121: Relational Databases Fall 2017 Lecture 22

Relational Algebra. Relational Query Languages

Syllabus. Syllabus. Motivation Decision Support. Syllabus

Data Warehouse Logical Design. Letizia Tanca Politecnico di Milano (with the kind support of Rosalba Rossato)

Data Warehouse and Data Mining

Transcription:

DW schema and the problem of views DW is multidimensional Schemas: Stars and constellations Typical DW queries, TPC-H and TPC-R benchmarks Views and their materialization View updates Main references [PJ01, C + 01, Joh02, Kot02]

Multidimensional Data Model Warehouse data is often thought of as multidimensional, yet frequently stored as relations.

Multidimensional Data Model What is a Data Model? Kinds of Data Models: Conceptual... Implementation... Physical Multidimensional Data Model(s) Registrar s Example

What is a Data Model? Answer: beats me :) Data model: an abstraction of the raw bits! Provides: 1. a data-description notation 2. basic operations (e.g., insert) to manipulate data Most CS undergrads have experienced the relational data model.

Defining Model One of those vague term everyone semi-understands. Model:... 3. A schematic description of a system, theory, or phenomenon that accounts for its properties and may be used for further study of its characteristics (ITP Nelson Canadian Dictionary) Helpful??

Conceptual Multidimensional Data Model Data are facts, eg Jill took CS5678 facts have numeric measure values (eg 87%) dimensions, eg Jill is a grad student CS4002 is an undergrad course. A cube represents facts, by mapping dimension combos to measures.

measure value, for fact "Jill got 87 in CS5678" Jill Jack Al CS5678 87 73 "students" dimension EE2222 CS4002 25 89 95 62 "courses" dimension empty cell, no fact about Jill and CS4002

More on cubes Cube generalizes idea of spreadsheet. Can have any number of dimensions. Another measure for fact Jill took CS5678 is the 503 times she yawned.

Registrar s Example 3-d cube, Session Student Course Grade mapping session, student, course to grades.

Session Spring 03 Summer 03 Course CS5678 CS4002 87 89 43 Jill Jack Student

Registrar s High-Dimensional Cube Realistic cubes can have dozens of dimensions. Registrar: Session Student Course Section Campus ForCredit Grade

Dimensions can have structure Dimension values can be organized into containment hierarchies. CS5678 is contained in Grad Courses EE2222 and CS4002 are in U/g Courses CS5678 and CS4002 are in CS Courses

Flat dimensions ( top ) means ALL. Simplest kind of dimension is flat, in that every value is a child of. Eg, Campus values are SJ and F. Or. Campus SJ F Schema Instance Schema ( Type info ) vs Instance ( Values ) overloaded as type and value; we have 3 Campus values!

Dimensions: can be tricky T T T Discipline Level or Kind EECourses U/G CSCourses Grad Course Course EE2222 CS4002 CS5678 Schema Instance How to handle this? Like multiple inheritance. Some multidimensional models forbid general lattice: demand balanced tree structure in instance.

Measures are Interesting Too! In Data Warehousing analyses, we aggregate. Measure has set of measure values eg real numbers (report a numeric property of a fact) aggregation operation (eg SUM, AVG, MEDIAN) distributive ones are nicest (SUM).

Measures are Interesting Too! (part 2) Best to consider the aggregation operation as hard-coded into a cube. There might be more than one measure to keep track of: SUM and AVG for example.

Views Conceptually, views are derived relations computed on the fly. But high-performance database systems often secretly materialize (pre-compute, store and keep updated) views for later use.

Views Conceptually, views are derived relations computed on the fly. But high-performance database systems often secretly materialize (pre-compute, store and keep updated) views for later use. It s not the analyst s business whether this is done... but it is a big issue for the DW designer. Crudely, queries should be answered from the smallest summary table possible.

Views Conceptually, views are derived relations computed on the fly. But high-performance database systems often secretly materialize (pre-compute, store and keep updated) views for later use. It s not the analyst s business whether this is done... but it is a big issue for the DW designer. Crudely, queries should be answered from the smallest summary table possible. Query-optimizer software should take care of this.

Aggregate Views What about CSCourses, we said it was a dimension value too! But there are no facts directly about anybody s performance on CSCourses.

Aggregate Views What about CSCourses, we said it was a dimension value too! But there are no facts directly about anybody s performance on CSCourses. They are views; compute them by averaging facts involving CS5678 and CS4002. A materialized view (created by aggregation) is a summary table. Summary tables usually have fewer dimensions than base cube.

Base cube and a summary cube Jill Jack Al 87 73 CS5678 Jill Jack Al 25 95 89 62 EE2222 CS4002 87 57 76.7 1 d "summary table" (Student > Grade) 87 89 67.5 materialized row for CSCourses 2 d cube (Student x Course > Grade)

Basic Operations An important part of any data model is what operations are provided?. Deferred to a later lecture. Soon, we describe relational storage, and a class of SQL queries.

Storing cubes in a relational database Relational technology is mature, robust, available. But somehow, we must map cubes into world of tuples and tables. Star Schema (now)

Storing cubes in a relational database Relational technology is mature, robust, available. But somehow, we must map cubes into world of tuples and tables. Star Schema (now) Snowflake Schema (later lecture)

Storing cubes in a relational database Relational technology is mature, robust, available. But somehow, we must map cubes into world of tuples and tables. Star Schema (now) Snowflake Schema (later lecture) Constellation (now)

Star Schema One main fact table one dimension table per dimension.

Star Schema One main fact table one dimension table per dimension. Fact table stores measure value AND for each dimension, a foreign key into the corresponding dimension table. Dimension table stores name of (lowest level) dimensional value and all higher-level dimension values that contain it.

Star Schema One main fact table one dimension table per dimension. Fact table stores measure value AND for each dimension, a foreign key into the corresponding dimension table. Dimension table stores name of (lowest level) dimensional value and all higher-level dimension values that contain it. Dimension table s key is a dummy value and might be the record-id number.

Star Schema Example Name comes from the fact table in the centre, with all the dimension tables radiating out from the centre.

Star Schema Example Name comes from the fact table in the centre, with all the dimension tables radiating out from the centre. Students Student Kind sid Jill grad 0 Jack grad 1 Al u/g 2 Facts sid Grade cid 0 87 0 0 73 2 1 25 1 1 95 2 2 89 1 2 62 2 (no column necessary for in dim tables.) Courses cid Course Discipline Level 0 CS5678 CSCourses g 1 EE2222 EECourses u 2 CS4002 CSCourses u

Constellation A fact constellation: several fact tables sharing common dimensions.

Constellation A fact constellation: several fact tables sharing common dimensions. Eg, Parking-office fact table Student Campus Number of Parking Violations Student dimension, at least, would be same as with registrar s star

DW Queries Aggregation is the tool to see the forest through the trees.

DW Queries Aggregation is the tool to see the forest through the trees. Common form of SQL query is SELECT attribs, aggr-expr... FROM fact,dim1,dim2,...where... GROUP BY attribs

DW Queries Aggregation is the tool to see the forest through the trees. Common form of SQL query is SELECT attribs, aggr-expr... FROM fact,dim1,dim2,...where... GROUP BY attribs SELECT kind, avg(grade) FROM Facts, Students WHERE Facts.sID = Students.sID GROUP BY kind

DW Query Example, Cont. SELECT kind, avg(grade) FROM Facts,Students WHERE Fact.sID = Students.sID GROUP BY kind is probably implemented by a star join between Facts and Students:

DW Query Example, Cont. SELECT kind, avg(grade) FROM Facts,Students WHERE Fact.sID = Students.sID GROUP BY kind is probably implemented by a star join between Facts and Students: Student kind sid Grade cid Jill grad 0 87 0 Jill grad 0 73 2 Jack grad 1 25 1 Jack grad 1 95 2 Al u/g 2 89 1 Al u/g 2 62 2 then kind avg(grade) grad 70 u/g 75.5

DW Query Example: Using Summary Tables SELECT kind, avg(grade) FROM Facts,Students WHERE Fact.sID = Students.sID GROUP BY kind But suppose that we already had a summary table giving the Student kind sid Avg(Grade) average grade for each student: Jill grad 0 80 Jack grad 1 60 Al u/g 2 75.5 Then, we might try to average Jack s avg grade with Jill s, to get an average grad grade. Might be faster.

DW Query Example: Using Summary Tables SELECT kind, avg(grade) FROM Facts,Students WHERE Fact.sID = Students.sID GROUP BY kind But suppose that we already had a summary table giving the Student kind sid Avg(Grade) average grade for each student: Jill grad 0 80 Jack grad 1 60 Al u/g 2 75.5 Then, we might try to average Jack s avg grade with Jill s, to get an average grad grade. Might be faster. But avg() is not distributive! (eg Jack took 1 course, Jill took 10).

Summary Tables: When faster for queries? Summary table typically much smaller than the fact table. When you can correctly answer a query from a summary table, speed might be helped by smaller data....

Summary Tables: When faster for queries? Summary table typically much smaller than the fact table. When you can correctly answer a query from a summary table, speed might be helped by smaller data.... But the main fact tables may have fast index built for it, which the summary table lacks. Moral: query optimization is tricky.

Aside: Performance benchmarks for DW systems The hardware, OS, and database all interact and are crucial for overall DW/OLAP performance. Cannot easily separate issues. Transaction Processing Council : neutral party that evaluates DB systems. See http://www.tpc.org

Aside: Performance benchmarks for DW systems The hardware, OS, and database all interact and are crucial for overall DW/OLAP performance. Cannot easily separate issues. Transaction Processing Council : neutral party that evaluates DB systems. See http://www.tpc.org Their TPC-H benchmark simulates an ad-hoc (OLAP-style) environment. Their TPC-R benchmark simulates canned queries typical of report generators.

Aside: Performance benchmarks for DW systems (part 2) Before you spend $160k USD for Microsoft SQL-server analysis services, see how it compares...

Choosing summary tables in DW design Either DW designer [or database system] needs to decide which summary tables to use. Issues: identifying candidates

Choosing summary tables in DW design Either DW designer [or database system] needs to decide which summary tables to use. Issues: identifying candidates potential size of each

Choosing summary tables in DW design Either DW designer [or database system] needs to decide which summary tables to use. Issues: identifying candidates potential size of each potential query benefit of each

Choosing summary tables in DW design Either DW designer [or database system] needs to decide which summary tables to use. Issues: identifying candidates potential size of each potential query benefit of each potential cost of keeping each updated

Choosing summary tables in DW design Either DW designer [or database system] needs to decide which summary tables to use. Issues: identifying candidates potential size of each potential query benefit of each potential cost of keeping each updated Do we know the queries that will be asked?

Identifying Candidate Summary Tables Common approach: consider summaries that are group-bys of some subset of fact-table columns (excluding the measures). Candidates belong to the data cube [GBLP97].

Data-Cube Aggregates Eg, for Facts(sID, cid, Grade) the possible candidates are 1. Select sid, cid, avg(grade) from Facts group by sid, cid ( = Facts!)

Data-Cube Aggregates Eg, for Facts(sID, cid, Grade) the possible candidates are 1. Select sid, cid, avg(grade) from Facts group by sid, cid ( = Facts!) 2. Select sid, avg(grade) from Facts group by sid

Data-Cube Aggregates Eg, for Facts(sID, cid, Grade) the possible candidates are 1. Select sid, cid, avg(grade) from Facts group by sid, cid ( = Facts!) 2. Select sid, avg(grade) from Facts group by sid 3. Select cid, avg(grade) from Facts group by cid

Data-Cube Aggregates Eg, for Facts(sID, cid, Grade) the possible candidates are 1. Select sid, cid, avg(grade) from Facts group by sid, cid ( = Facts!) 2. Select sid, avg(grade) from Facts group by sid 3. Select cid, avg(grade) from Facts group by cid 4. Select avg(grade) from Facts Note that if we choose to materialize 2 and 4, we can first compute 2. Then 4 from 2.

Data-Cube Aggregates Eg, for Facts(sID, cid, Grade) the possible candidates are 1. Select sid, cid, avg(grade) from Facts group by sid, cid ( = Facts!) 2. Select sid, avg(grade) from Facts group by sid 3. Select cid, avg(grade) from Facts group by cid 4. Select avg(grade) from Facts Note that if we choose to materialize 2 and 4, we can first compute 2. Then 4 from 2. (Likewise, 4 can be computed from 3)

Sizes of Summary Tables Various sophisticated techniques can try to predict the size of a summary table. Deferred till next week.

Benefit of Summary Table Basically, depends on smallness... and how often it can be used to answer queries. Deferred till next week.

Updating Summary Tables Possible meaning, What do we do, if someone tries to insert or delete into a view?. This is nasty... and not what we mean.

Updating Summary Tables Possible meaning, What do we do, if someone tries to insert or delete into a view?. This is nasty... and not what we mean. Our meaning, The summary table is computed from some data. If that data changes, the summary table is wrong.

Options for Updating Flag out of date by triggering on base-relation update. If anyone tries to use flagged summary table, force its recomputation. Potentially expensive

Options for Updating Flag out of date by triggering on base-relation update. If anyone tries to use flagged summary table, force its recomputation. Potentially expensive Accept some out-of-dateness, nightly/weekly rebuild. error Introduces

Options for Updating Flag out of date by triggering on base-relation update. If anyone tries to use flagged summary table, force its recomputation. Potentially expensive Accept some out-of-dateness, nightly/weekly rebuild. error Introduces Differential algorithms: update the summary incrementally as base relation changes. Next topic

Incremental Updates of Aggregate Views See [Kot02, Section 8] Suppose we materialize view V, whose definition is SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid

Incremental Updates of Aggregate Views See [Kot02, Section 8] Suppose we materialize view V, whose definition is SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F + be a set of new tuples added to Facts.

Incremental Updates of Aggregate Views See [Kot02, Section 8] Suppose we materialize view V, whose definition is SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F + be a set of new tuples added to Facts. Calculate V + as

Incremental Updates of Aggregate Views See [Kot02, Section 8] Suppose we materialize view V, whose definition is SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F + be a set of new tuples added to Facts. Calculate V + as SELECT cid, sum(grade) as sg, max(grade)as mg FROM F + GROUP BY cid Then the new V should be something like SELECT cid, sum(sg) as sg, max(mg) as mg FROM (V union V + ) GROUP BY cid

Decremental Updates of Aggregate Views As before materialized V has definition SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F be a set of tuples deleted from Facts.

Decremental Updates of Aggregate Views As before materialized V has definition SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F be a set of tuples deleted from Facts. Calculate V as SELECT cid, -1*sum(Grade) as sg, max(grade)as mg FROM F + GROUP BY cid

Decremental Updates of Aggregate Views As before materialized V has definition SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F be a set of tuples deleted from Facts. Calculate V as SELECT cid, -1*sum(Grade) as sg, max(grade)as mg FROM F + GROUP BY cid Then the new V should be something like SELECT cid, sum(sg) as sg,??? as mg FROM (V union V ) GROUP BY cid

Decremental Updates of Aggregate Views As before materialized V has definition SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F be a set of tuples deleted from Facts. Calculate V as SELECT cid, -1*sum(Grade) as sg, max(grade)as mg FROM F + GROUP BY cid Then the new V should be something like SELECT cid, sum(sg) as sg,??? as mg FROM (V union V ) GROUP BY cid Problems: sum of 0: no tuples in group? Or just sum to 0? add COUNT to view

Decremental Updates of Aggregate Views As before materialized V has definition SELECT cid, sum(grade) as sg, max(grade) as mg FROM Facts GROUP BY cid Let F be a set of tuples deleted from Facts. Calculate V as SELECT cid, -1*sum(Grade) as sg, max(grade)as mg FROM F + GROUP BY cid Then the new V should be something like SELECT cid, sum(sg) as sg,??? as mg FROM (V union V ) GROUP BY cid Problems: sum of 0: no tuples in group? Or just sum to 0? add COUNT to view Also: What about?? no anti-max trick!

Differential Updates of SPJ-Views See [Joh02, Section 4]. SPJ means Select Project Join.

Differential Updates of SPJ-Views (part 2) Consider two relations R and S. SPJ queries (in the relational algebra) have the form π Y (σ X (S R))

Differential Updates of SPJ-Views (part 2) Consider two relations R and S. SPJ queries (in the relational algebra) have the form π Y (σ X (S R)) or equivalantly in SQL SELECT Y FROM S, R WHERE X.

Example SPJ-View Eg view on Registrar s database CREATE VIEW UG advisor AS SELECT Student, Grade, cid FROM Fact, Students WHERE Fact.sID = Students.sID AND Students.Kind = u/g The UG advisor does not see grad students.

Incremental update of SPJ-view V V = π Y (σ X (S R)) Let A R and A S respectively be the new tuples for R and S. V = V π Y (σ X (A S R) π Y (σ X (S A R ) π Y (σ X (A S A R )

Incremental update of SPJ-view V V = π Y (σ X (S R)) Let A R and A S respectively be the new tuples for R and S. V = V π Y (σ X (A S R) π Y (σ X (S A R ) π Y (σ X (A S A R ) If A S and A R are small, this is a cheap update.

SPJ Decrements too! Let D R and D S respectively be the deleted tuples for R and S. Now let R = R D R and S = S D S.

SPJ Decrements too! Let D R and D S respectively be the deleted tuples for R and S. Now let R = R D R and S = S D S. Then V = V π Y (σ X (S D R )) π Y (σ X (D S R )) π Y (σ X (D S D R )) π Y (σ X (S A R )) π Y (σ X (A S R )) π Y (σ X (A S A R ))...

SPJ Decrements too! Let D R and D S respectively be the deleted tuples for R and S. Now let R = R D R and S = S D S. Then V = V π Y (σ X (S D R )) π Y (σ X (D S R )) π Y (σ X (D S D R )) π Y (σ X (S A R )) π Y (σ X (A S R )) π Y (σ X (A S A R ))... Not quite right, deletions for SPJ also require maintaining counts in tuples... see Johnson.

References [C + 01] Surajit Chaudhuri et al. Database technology for decision support systems. IEEE Computer, pages 48 55, December 2001. [GBLP97] J. Gray, A. Bosworth, A. Layman, and H. Pirahesh. Data cube: a relational aggregation operator generalizing group-by, cross-tabs and subtotals. Number 1, pages 29 53, 1997. [Joh02] Theodore Johnson. Data warehousing. In J. Abello et al., editors, Handbook of Massive Data Sets, chapter 19, pages 661 710. Kluwer, 2002. [Kot02] Yannis Kotidis. Aggregate view management in data warehouses. In

J. Abello et al., editors, Handbook of Massive Data Sets, chapter 20, pages 711 741. Kluwer, 2002. [PJ01] Torben Bach Pedersen and Christian S. Jensen. Multidimensional database technology. IEEE Computer, pages 40 46, December 2001.