Title: Query Processing in Sensor Networks
1Query Processing in Sensor Networks
11/09/2006
Se Ho Park Hyun Ik Jang Frolin Rusu
W. Hong S. Madden Implementation and Research
Issues in Query Processing for Wireless Sensor
Networks, ICDE 2004
2Outline
3Outline
4Query Processor
5(No Transcript)
6TinyDB
Root (gateway node)
Distributed in Network Query processor
Wireless Sensor networks
7Client PC-Base station
Query parsing Query optimization
Query result storage and display
Data
Query
Routing Tree
8Outline
9(No Transcript)
10SELECT ltaggregatesgt, ltattributesgt FROM sensors
ltbuffergt WHERE ltpredicatesgt GROUP BY
ltexprgt HAVING ltpredicatesgt SAMPLE PERIOD
ltconstgt ONCE INTO ltbuffergt
11- Single table in FROM clause
- No sub-queries
- No column alias in SELECT clause
- Only fundamental difference SAMPLE PERIOD clause
- The result of query is a stream of values (rather
than single aggregate value)
12TinySQL Example
13Event-based Queries
- ON event SELECT
- Run query only when interesting events happen
- Event examples
- Button pushed
- Message arrival
- Bird enters nest
- Analogous to triggers but events are user-defined
14Query over Stored Data
- Named buffers in Flash memory
- Store query results in buffers
- Query over named buffers
- Analogous to materialized views
- Example
- CREATE BUFFER name SIZE x (field1 type1, field2
type2, ) - SELECT a1, a2 FROM sensors SAMPLE PERIOD d INTO
name - SELECT field1, field2, FROM name SAMPLE PERIOD d
15Outline
16Tree-based Routing
- Tree-based routing
- Used in
- Query delivery
- Data collection
- In-network aggregation
17Basic Aggregation
- In each epoch
- Each node samples local sensors once
- Generates partial state record (PSR)
- local readings
- readings from children
- Outputs PSR during assigned comm. interval
- At end of epoch, PSR for whole network output at
root - New result on each successive epoch
18Illustration Aggregation
Interval 4
Interval
19Illustration Aggregation
Interval 3
Interval
20Illustration Aggregation
Interval 2
Interval
21Illustration Aggregation
Interval 1
Interval
22Illustration Aggregation
Interval 4
Interval
23Outline
24Inside TinyDB
Multihop Network
Query Processor
Schema
TinyOS
TinyDB
25Acquisitional Query Processing (ACQP)
- TinyDB acquires AND processes data
- Could generate an infinite number of samples
- An acqusitional query processor controls
- when,
- where,
- and with what frequency data is collected!
- Versus traditional systems where data is provided
a priori
26ACQP Whats Different?
- How should the query be processed?
- Sampling as a first class operation
- How does the user control acquisition?
- Rates or lifetimes
- Event-based triggers
- Which nodes have relevant data?
- Index-like data structures
- Which samples should be transmitted?
- Prioritization, summary, and rate control
27Operator Ordering Interleave Sampling Selection
- E(sampling mag) gtgt E(sampling light)
- 1500 uJ vs. 90 uJ
- SELECT light, mag
- FROM sensors
- WHERE pred1(mag)
- AND pred2(light)
- SAMPLE PERIOD 1s
28Conclusions
- Architecture
- Data Model and Query Language
- Query Dissemination and Result Collection
- Query Processing
29(No Transcript)