VLDB 2002 A One-Pass Aggregation Algorithm with the Optimal Buffer - - PowerPoint PPT Presentation

vldb 2002
SMART_READER_LITE
LIVE PREVIEW

VLDB 2002 A One-Pass Aggregation Algorithm with the Optimal Buffer - - PowerPoint PPT Presentation

VLDB 2002 A One-Pass Aggregation Algorithm with the Optimal Buffer Size in Multidimensional OLAP September 23, 2002 Young-Koo Lee, Kyu-Young Whang, Yang-Sae Moon, and Il-Yeol Song Department of Computer Science and Advanced Information


slide-1
SLIDE 1

September 23, 2002

KAIST

1

VLDB 2002

A One-Pass Aggregation Algorithm with the Optimal Buffer Size in Multidimensional OLAP

September 23, 2002 Young-Koo Lee, Kyu-Young Whang, Yang-Sae Moon, and Il-Yeol Song Department of Computer Science and Advanced Information Technology Research Center(AITrc) KAIST, Korea

slide-2
SLIDE 2

September 23, 2002

KAIST

2

Overview

Introduction Motivation and Goals Computation Model Based on Disjoint-Inclusive Partition One-Pass Aggregation Algorithm and Its Optimality Experimental Results Conclusions

slide-3
SLIDE 3

September 23, 2002

KAIST

3

On-Line Analytical Processing: OLAP

OLAP is a database application that allows users to easily analyze large volumes of data in order to extract information necessary for decision making Example: Customer Data Analysis Multidimensional OLAP: MOLAP

  • Uses multidimensional files as storage structures

40,000 30,000 20,000 10,000

Y e a r Age Sales (values in cells)

10 20 30 40 50 1998

10 20 30 50 40 30 70 20 20 60

Income

1999 2000 2001

  • Query Example:

Find the total sales for each age

slide-4
SLIDE 4

September 23, 2002

KAIST

4

Aggregation

Definition (Aggregation):

An operation that classifies records into groups and determines one value per group by applying the given aggregate function [Graefe 93]

  • Grouping attributes: the attributes used for grouping
  • Aggregated attribute: the attribute to which the aggregate function is applied

Examples:

  • Find the total sales
  • Find the total sales for each year

OLAP queries make heavy use of aggregation for summarizing data Since computing aggregation is very expensive, good aggregation algorithms are crucial for achieving performance in OLAP systems

slide-5
SLIDE 5

September 23, 2002

KAIST

5

Terminology

Organizing attributes: a subset of attributes that determines the placement

  • f records in the multidimensional file (i.e., attributes that correspond to

dimensions) Domain:a set of values from which an attribute value can be drawn Domain space: the Cartesian product of all domains Page region: a region associated with a disk page Grouping domain space: the Cartesian product of the domains of all the grouping attributes Grouping region: any subset of the grouping domain space Page grouping region: the projection of the page region onto the grouping domain space

slide-6
SLIDE 6

September 23, 2002

KAIST

6

Related Work

Aggregation using multidimensional arrays [Zhao et al. 97]

  • Stores data in a multidimensional array
  • Computes aggregation by accessing records in the unit of a page along the line

perpendicular to the axis of the grouping attribute

  • Is not efficient for skewed distributions

(a) accessing in the unit of cells

  • Example: Aggregation of Y values for each X value in X-Y two dimensional space

1 8 3 2 4 6 3 2 7 1 2 4 2 3 4 3 2 2 3 4 1 3 8 4 1 2 2 1 9 1 y0 y1 y2 y3 y4 y5 y6 y7 2 8 1 2 3 2 5 1 1 1 2 x0 x1 x2 x3 x4 x5 x6 x7 x8 y8

(b) accessing in the unit of pages X Y

1 8 3 2 4 6 3 2 7 1 2 4 2 3 4 3 2 2 3 4 1 3 8 4 1 2 2 1 9 1 y0 y1 y2 y3 y4 y5 y6 y7 2 8 1 2 3 2 5 1 1 1 2 x0 x1 x2 x3 x4 x5 x6 x7 x8 y8

: cell : page region

X Y

slide-7
SLIDE 7

September 23, 2002

KAIST

7

Our Approach

To use a dynamic multidimensional file that handles skewed distributions efficiently

slide-8
SLIDE 8

September 23, 2002

KAIST

8

A Naïve Aggregation Method Using a Dynamic Multidimensional File

  • The aggregation is computed as the union
  • f partial aggregations, each of which is

computed for an aggregation window

  • Definition: Aggregation windows are

grouping regions that form a partition of the grouping domain space and that are used to compute aggregation

  • Partial aggregation for an aggregation

window is computed by retrieving records through a range query against the multidimensional file

E C B A D F

0 50 75 99 99 50 9 9 5

Aggregation of Z values for each pair of X and Y values in a three dimensional space : aggregation windows

X Y Z

W1 W2 W3 W4

slide-9
SLIDE 9

September 23, 2002

KAIST

9

Problems

  • The pages having large regions

are accessed multiple times

  • Example:
  • Page F (marked by blue color) is

accessed twice since its page grouping region overlaps with two aggregation windows W3 and W4

E C B A D F

0 50 75 99 99 50 9 9 5

Aggregation of Z values for each pair of X and Y values in a three dimensional space : aggregation windows

X Y Z

W1 W2 W3 W4

slide-10
SLIDE 10

September 23, 2002

KAIST

10

Solution

Use buffer Control the order of accessing pages to maximize the buffering effect

slide-11
SLIDE 11

September 23, 2002

KAIST

11

Buffer Replacement Policies

When the order of accessing pages is unknown

  • The common strategy is to select the page that has the longest expected time

until the next access

  • Examples: LRU [Coffman et al. 73], CLOCK [Effelsberg et al.84], LRU-k

[O’Neil et al. 93]

When the order of accessing pages is known in advance

  • Belady’s B0 [Coffman et al. 73]: selects as a victim the page that has the longest

time until the next access − Proven to be the optimal buffer replacement policy

  • Toss-Immediate [Korth et al. 91]: upon each page access, immediately

invalidates the page that will not be used further

Since the order of accessing pages is not known a priori in general, Belady’s B0 and Toss-Immediate policies have been known to lack practicality Nevertheless, in this paper, we show that these policies can be effectively used for aggregation computation

slide-12
SLIDE 12

September 23, 2002

KAIST

12

Goals

We propose an aggregation method that uses dynamic multidimensional files adapting to skewed distributions We present a formal basis for aggregation computation, called the Disjoint-Inclusive Partition (DIP) computation model We propose an aggregation method that maximizes the buffering effect by controlling the page access order We formally prove that our algorithm achieves the optimal

  • ne-pass buffer size under the DIP computation model,

which is the minimum buffer size required for one disk access per page

slide-13
SLIDE 13

September 23, 2002

KAIST

13

Disjoint-Inclusive Partition

  • When page regions and aggregation windows have certain topological

relationships, we can improve the performance and buffering effect of computing aggregation by exploiting them

  • Definition 1: Two regions S1 and S2 satisfy the disjoint-inclusive

relationship if either S1 and S2 are disjoint or one includes the other

  • Definition 2: A disjoint-inclusive partition (DIP) of the domain space D

is a set Q of regions satisfying the following conditions:

(1) Q is a partition of D (2) When two regions in Q are projected onto any subspace, the projected regions satisfy the disjoint-inclusive relationship

  • Definition 3: We call a multidimensional file whose page regions form

a DIP a DIP multidimensional file

slide-14
SLIDE 14

September 23, 2002

KAIST

14

Example: A DIP and a non-DIP

ΠGF E C B A D F A C B E D ΠGA ΠGB ΠGE ΠGB ΠGC ΠGD ΠGE

X Y Z

  • Organizing attributes:

X, Y, Z

  • Set of grouping

attributes G = {X, Y}

ΠGA ΠGC ΠGD

(a) A DIP. (b) A non-DIP. ΠGA and ΠGD (also ΠGA and ΠGE ) do not satisfy the disjoint-inclusive relationship

slide-15
SLIDE 15

September 23, 2002

KAIST

15

DIP Computation Model

Definition: The DIP computation model for computing aggregations using a multidimensional file is the one that satisfies the following four conditions:

(1) It uses a DIP multidimensional file (2) The aggregation for the grouping domain space is computed as the union of partial aggregations for aggregation windows (3) Disjoint-inclusive relationship is satisfied among aggregation windows and page grouping regions (4) Each partial aggregation is computed by retrieving records through a range query against the multidimensional file

slide-16
SLIDE 16

September 23, 2002

KAIST

16

Controlling the Order of Accessing Pages

Definition (L-page):

A page P is an L-page (large page) of an aggregation window Wi if the page grouping region of P properly includes Wi

Objective

  • To make an L-page be accessed from disk only once by accessing the

pages in a specific order

For this specific order, we propose an optimal space filling curve, called Induced Space Filling Curve, based on the formal properties of DIP

slide-17
SLIDE 17

September 23, 2002

KAIST

17

Induced Space Filling Curve (ISFC)

Definition (Induced Space Filling Curve (ISFC)) : A space filling curve induced from a given set of regions so that it can traverse all smaller regions included in a region Si, and then, traverse those that are not included in Si Lemma 2: For a given set S of regions, where elements of S satisfy the disjoint-inclusive relationship, there exists at least one ISFC Definition (ISFCR∪W): ISFC based on the given set R∪W

  • R: a set of page grouping regions in a DIP multidimensional file
  • W: a set of aggregation windows

Lemma 3: When traversing the aggregation windows in ISFCR∪W

  • rder, L-pages are accessed in contiguous aggregation windows
slide-18
SLIDE 18

September 23, 2002

KAIST

18

Example: An ISFCR∪W and a non-ISFCR∪W

R1=ΠGA R2=ΠGB R3= ΠGC R5=ΠGE X R4= ΠGD R6=ΠGF Y (b) Aggregation windows (Wi’s). X Y W3 W1 W4 W2 (a) Page grouping regions (Ri’s). W3 W1 W4 W2 W3 W1 W4 W2 X Y X Y (c) An ISFCR∪W. (d) A non-ISFCR∪W. ISFCR∪W order:

R1(W1W2) R6(W4(R3R4) W3(R2)) Traversing order for Wi’s: W1W2W4W3

R1 R2 R3 R5 R4 R6 R1 R2 R3 R5 R4 R6

slide-19
SLIDE 19

September 23, 2002

KAIST

19

The One_Pass_Aggregation Algorithm

Uses DIP computation model Traverses aggregation windows in an ISFCR∪W order Uses Belady’s B0 or Toss-Immediate as the buffer replacement policy

slide-20
SLIDE 20

September 23, 2002

KAIST

20

Toss-Immediate Policy

When traversing the aggregation windows in the order of ISFCR∪W , we can identify in Lemma 4 the page that will no longer be accessed

Toss-Immediate

Lemma 4: A page Pcurr accessed during partial aggregation for Wcurr will no longer be accessed if it satisfies the following condition:

− The ISFCR∪W value of Wcurr is greater than or equal to that of the page grouping region of Pcurr

Similarly, we can use Belady’s B0

− Details are referred to a future paper

slide-21
SLIDE 21

September 23, 2002

KAIST

21

Algorithm One_Pass_Aggregation Input: (1) DIP multidimensional file md-file that contains OLAP data (2) Set G of grouping attributes (3) Aggregated attribute A Output: Result of aggregation 1 Partition the grouping domain space into aggregation windows so that aggregation windows and page grouping regions satisfy the disjoint-inclusive relationship. 2 Initialize the buffer:

2.1 Compute the one-pass buffer size, BUFSIZE= 2.2 Allocate the buffer of size BUFSIZE

3 Traversing aggregation windows in ISFCR∪W order, for each aggregation window Wcurr, DO

3.1 Construct a range query. Here the query region consists of the intervals corresponding to the aggregation window for the grouping attributes and the entire domain of each attribute for the other organizing attributes. 3.2 Process the range query against md-file 3.2.1 While evaluating the range query, when processing the current page Pcurr is completed, if ISFCR∪W (ΠG Pcurr) ≤ ISFCR∪W ( ΠG Wcurr), then remove Pcurr from the buffer. 3.2.2 For each record retrieved, using the values of the attributes in G, find the corresponding entry from the window result table, aggregate the value of the attribute A, and store the result into the entry.

{(the number of L-pages of ) }

max

i

W i i

W α +

~

slide-22
SLIDE 22

September 23, 2002

KAIST

22

Optimal One-Pass Buffer Size under DIP Computation Model

Definition: The one-pass buffer size is the minimum buffer size required for guaranteeing one disk access per page Theorem 1 (and 2): The optimal one-pass buffer size under the DIP computation model is

  • W={W1,W2,…,Wk} is a set of aggregation windows
  • αi is 1 if at least one aggregation window page of Wi is a non-L-page

and if it is accessed after all the L-pages of Wi have been read into the buffer; αi is 0 otherwise

the number of L-pages of {( ) }

max

i

W i i

W α +

slide-23
SLIDE 23

September 23, 2002

KAIST

23

Proof (intuitive):

  • The buffer should contain as many pages as the number of L-pages
  • By traversing the aggregation windows in the order of ISFCR∪W, L-

pages are accessed in contiguous aggregation windows (Lemma 3)

  • By using the Toss-Immediate policy, the L-page contiguously accessed
  • nce is immediately invalidated and will not be accessed further
  • In addition, one page is needed to fetch a non-L-page into the buffer if it

exists

  • Detailed proof is in the paper
slide-24
SLIDE 24

September 23, 2002

KAIST

24

Optimality of One_Pass_Aggregation Algorithm

Theorem 2: The one-pass buffer size of the One_Pass_Aggregation algorithm is equal to the optimal

  • ne-pass buffer size of the DIP computation model

Proof: See the paper

slide-25
SLIDE 25

September 23, 2002

KAIST

25

Experiments

Objectives

  • We demonstrate that the one-pass buffer size theoretically derived is

indeed correct in real environments

  • We compare the performance of the one-pass algorithm with those of
  • ther ones
  • We show that our algorithm requires a relatively small amount of main

memory for processing the aggregation in one pass

slide-26
SLIDE 26

September 23, 2002

KAIST

26

Algorithms Compared:

Toss- Immediate ISFCR∪W YES One_Pass_Aggregation CLOCK ISFCR∪W YES ISFC_Aggregation CLOCK Hilbert YES DIP_Aggregation CLOCK Row-major NO Naïve_Aggregation Buffer replacement policy Traversal order for aggregation windows Conformance to DIP computation model

slide-27
SLIDE 27

September 23, 2002

KAIST

27

Experimental environment

Multidimensional file used:

MLGF [Whang and Krishnamurthy 85]

Data sets: Records consisting of six attributes (five attributes: dimensions, one attribute: measure). Three among five dimensions are used as grouping attributes

1) SYNTHETIC-DATA: a synthetic data set with a distribution that superposes 100 overlapping multivariate normal distributions simulating multiple clusters − SMALL-DATA: 500,000 records (29.9MB) − MEDIUM-DATA: 5,000,000 records (279.3MB) − LARGE-DATA: 50,000,000 records (2,648.3MB) 2) REAL-DATA: the Forest Cover Type data with about 600,000 records (http://kdd.ics.uci.edu/)

slide-28
SLIDE 28

September 23, 2002

KAIST

28

Measures

  • Normalized I/O accesses =
  • Main memory requirement

Number of page accesses Total number of pages in the file

slide-29
SLIDE 29

September 23, 2002

KAIST

29

Normalized I/O Accesses (MEDIUM-DATA)

The one-pass buffer size computed experimentally turns out to be equal to that predicted in Theorem 2 One_Pass_Aggregation > ISFC_Aggregation > DIP_Aggregation > Naïve_Aggregation

0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00 10 20 30 40 50 60 70 80 90 100 110

buffer size in pages normalized I/O access Naive_Aggregation DIP_Aggregation ISFC_Aggregation One_Pass_Aggregation

  • ne-pass

buffer size (=94)

slide-30
SLIDE 30

September 23, 2002

KAIST

30

Normalized I/O Accesses (REAL-DATA)

Performance gaps are more marked in REAL-DATA

  • There is more random variation in data distribution for real data than for

synthetic data

0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 10 20 30 40 50 60 70 80 90 100 110

buffer size in pages normalized I/O accesses Naive_Aggregation DIP_Aggregation ISFC_Aggregation One Pass Aggregation

  • ne-pass

buffer size (=49)

slide-31
SLIDE 31

September 23, 2002

KAIST

31

Memory Requirement of the One_Pass_Aggregation Algorithm

Total main memory requirement = one-pass buffer size + window result table size The window result table is memory used to contain the result of partial aggregation for an aggregation window

(a) SMALL-DATA (b) MEDIUM-DATA

0.0% 0.2% 0.4% 0.6% 0.8% 1.0% 1.2% 0.0% 0.1% 0.2% 0.3% 0.4% 0.5% 0.6% 0.7% 0.8% 0.9% 1.0%

window result table size as the ratio to the database size normalized memory size

0.0% 0.2% 0.4% 0.6% 0.8% 1.0% 1.2% 0.0% 0.1% 0.2% 0.3% 0.4% 0.5% 0.6% 0.7% 0.8% 0.9% 1.0%

window result table size as the ratio to the database size

normalized memory size

window result table size

  • ne-pass buffer size

memory requirement

slide-32
SLIDE 32

September 23, 2002

KAIST

32 (c) LARGE-DATA (d) REAL-DATA

0.0% 0.1% 0.2% 0.3% 0.4% 0.5% 0.6% 0.0% 0.1% 0.2% 0.3% 0.4% 0.5%

window result table size as the ratio to the database size

normalized memory size

0.0% 0.2% 0.4% 0.6% 0.8% 1.0% 1.2% 1.4% 0.0% 0.1% 0.2% 0.3% 0.4% 0.5% 0.6% 0.7% 0.8% 0.9% 1.0%

window result table size as the ratio to the database size normalized memory size

window result table size

  • ne-pass buffer size

memory requirement

The memory requirement for processing the aggregation in one pass is very small being 0.05% ~ 0.60% of the size of the database

slide-33
SLIDE 33

September 23, 2002

KAIST

33

Conclusions

We have presented an aggregation algorithm that uses dynamic multidimensional files adapting to skewed distributions We have presented the new notion of the disjoint-inclusive partition (DIP) and proposed a formal basis for aggregation computation, called the DIP computation model We have formally derived the optimal one-pass buffer size under the DIP computation model (Theorems 1 and 2) We have proposed the One_Pass_Aggregation algorithm that utilizes the page access order computed in advance We have proven that the One_Pass_Aggregation algorithm has the optimal one-pass buffer size We believe we have provided an excellent formal basis for investigating further issues in computing aggregations in MOLAP