Professional Documents
Culture Documents
Niagaracq: A Scalable Continuous Query System For Internet Databases
Niagaracq: A Scalable Continuous Query System For Internet Databases
Niagaracq: A Scalable Continuous Query System For Internet Databases
Jianjun Chen et al
Computer Sciences Dept.
University of Wisconsin-Madison
SIGMOD 2000
Presented by
Mukund Agrawal
Continuous Queries
A triple ( Q, A, Stop)
Scope also includes future data
Example
Inform me when there is a new publication related to
multi-query optimization
A broad classification
Change based
Timer based
NiagaraCQ
A CQ system for the Internet
Continuous Queries on XML data sets
Scalable CQ processing
Incremental group optimization
Handles both change based and timer based
queries in a uniform way
Outline
General strategy of incremental group
optimization
Query split with materialized intermediate
files
Incremental grouping of selection and join
operators
System architecture
Experimental results
NiagaraCQ command language
Creating a CQ
Create CQ_name
XML-QL query
Do action
{ START start_time} { EVERY time_interval}
{ EXPIRE expiration_time}
Delete CQ_name
Incremental group optimization
General Strategy
Where <Quotes><Quote><Symbol>MSFT</></></>
element_as $g in “http://www.stock.com/quotes.xml”
construct $g
Expression signatures
=
Quotes.Quote.Symbol constant
in quotes.xml
Query plans
Trigger Action I Trigger Action J
Select Select
Symbol = “INTC” Symbol = “MSFT”
quotes.xml quotes.xml
Group
Group Signature
Common signature of all queries in the group
Constant_value Dest_buffer
INTC Dest. I
MSFT Dest. J
The group plan
Incremental Grouping Algo
When a new query is submitted
If the expression signature of the new query
matches that of existing groups
Break the query plan into two parts
Remove the lower part
Add the upper part onto the group plan
else create a new group
Query split with materialized
intermediate files
Why not use a pipeline scheme ?
Split operator may block simple queries
Gives a single complicated execution plan
A large portion of query plan may not need to be
executed at each invocation
Does not work for grouping timer based queries
Disadvantages
Split operator becomes a blocking operator
Extra disk I/Os
Incremental grouping of
selection predicates
Multiple selection predicates in a query
CNF for predicates on same data source
Incremental grouping
Choose the most selective conjunct
Evaluation of other predicates
Upper levels of continuous query
Example query
Where <Quotes><Quote><Symbol>”INTC”</>
<Current_Price>$p</></> element_as $g </>
in “quotes.xml”, $p < 100
Construct $g
Range-query groups
Problem
Intermediate files may contain duplicate tuples
Event List
Stores time events sorted in time order
Incremental evaluation
Invoke queries only on changed data