CSE 599c Hot Topics in Data Management Systems

Lecture 6: Continuous and Adaptive

Query Processing

Magdalena Balazinska

Winter 2006

Today's Paper

S. Madden, M. Shah, J. Hellerstein, and V. Raman. Continuously Adaptive Continuous Queries over Streams. SIGMOD 2002.

Outline

Problem

CACQ approach

Single query no joins: Eddy + tuple lineage

Multiple queries: grouped filter + more lineage

Joins: SteMs

Putting it all together

Discussion of routing policy and performance

Discussion of overall paper

Paper Contributions

Problem

Efficiently process multiple continuous queries over unbounded streams

Approach

Continuously adapt to changing conditions

Eddy operator

Share operators and state between queries

Lineage, predicate indices, SteMs

Single Query, No Joins

Data source: Temperature T

Q0: T.temp < 68 AND T.loc=A and T.time > 8am

Goal: dynamically adapt order of selections

Single Query, No Joins

Eddy

Temp

stemp<68

sloc=A

stime>8am

1

1

1

Ready

0

0

0

Done

Lineage for each tuple

Multiple Queries, No Joins

Data source: Temperature T

Q1: T.temp < 75 (s1) AND T.loc=A (s2)

Q2: T.temp < 72 (s3) AND T.time > 8am (s4)

Q3: T.temp < 68 (s5) AND T.loc=A (s6)	AND T.time > 8am (s7)

Paper, Figure 1

Multiple Queries, No Joins

1

1

1

Ready

0

0

0

Done

Lineage for each tuple

0

0

0

queriesCompleted

1

1

1

1

1

1

1

1

0

completionMask Q1

1

0

1

completionMask Q2

1

1

1

completionMask Q3

Optimizations:

Figures 2 and 3

Grouped Filter

One grouped filter per attribute and source

Four data structures

greater than balanced binary tree

less than balanced binary tree

equality hash-table

inequality hash-table

Figure 5

Multiple Queries with Joins

Data sources: Temperature T and Light L

Q1: T.temp < 75 AND T.loc=A and T.loc=L.loc

Q2: T.temp < 72 AND T.time > 8am

Q3: T.temp < 68 AND T.loc=A AND T.time > 8am

2006-01-01T23:16:26