Mario A. Nascimento
- Univ. of Alberta, Canada
http: //www.cs.ualberta.ca/~mn
With R. Alencar and A. Brayner. Work partially supported by NSERC and CBIE (Canada) and CAPES (Brazil)
D ATA C ACHING IN WSN Mario A. Nascimento Univ. of Alberta, Canada - - PowerPoint PPT Presentation
D ATA C ACHING IN WSN Mario A. Nascimento Univ. of Alberta, Canada http: //www.cs.ualberta.ca/~mn With R. Alencar and A. Brayner. Work partially supported by NSERC and CBIE (Canada) and CAPES (Brazil) Outline Outline Motivation
With R. Alencar and A. Brayner. Work partially supported by NSERC and CBIE (Canada) and CAPES (Brazil)
2
2 /23
Motivation Cache-Aware Query Processing Cache-Aware Query Optimization
Query Partitioning Cached Data Selection
Cache Maintenance Experimental Results
3
3 /23
User WSN Station Base Satellite User User User
4
4 /23
Q’ 2 P 1 P 3 Q (a) (b) P
5
5 /23
(b) BS SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN BS SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN SN (a)
6
6 /23
Base Station WSN Processor Query Cache Manager Cache Index Query Optimizer User D( ) P’, D(P’) Q, P’’,
D(Q) P Q Q, P’
Current query Relevant Cached Queries Non-stale subset of P and its dataset Subset of relevant queries and sub-queries (min: query cost) Answer
7
7 /23
For obtaining Q’ we used the General Polygon Clipper library. For partitioning Q’ into the set of sub-queries Θ we used a O(v log v) algorithm which finds a sub-optimal solution (minimizing the number
8
8 /23
4 P’’ = P’ P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ , P’ } P’’ = P’ \ {P’ , P’ } 1 2 3 4 2 1 P’’ = P’ \ {P’ , P’ } 2 3 2
9
9 /23
4 P’’ = P’ P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ } P’’ = P’ \ {P’ , P’ } P’’ = P’ \ {P’ , P’ } 1 2 3 4 2 1 P’’ = P’ \ {P’ , P’ } 2 3 2
10
10 /23
Cache Updater Cache Index Query Processor P’, D(P’) Q P’, P’’, Q, P \ P’, P’ \ P’’, Q P Cache Manager (internals) P \ P’
11
11 /23
3 1 2 P (used) Q’ Data that can be used to refresh P ’s data 1 P2 Q (a) (b) (c) P P P 1,1 1,2 P (dropped)
12
12 /23
2 4 6 8 10 12 > 1 ( 8
] ( 6
] ( 4
] ( 2
] ( 1
] < 1 Frequency [%] Energy loss (range) wrt OPT [%] B+B GrF GrE
B+B is the Branch-and-Bound heuristic. GrF (GrE) is an aggressive greedy heuristic, starting with all (no) cache and removing (inserting) the smallest (largest) cached queries available as long as there is some gain.
13
13 /23
2 3 4 5 6 7 8 9 10 11 12 ( 8
] ( 6
] ( 4
] ( 2
] (
] Frequency [%] Energy savings (range) wrt no cache [%] B+B GrF GrE
By design GrE cannot be any worse that no using any cache.
14
14 /23
5 10 15 20 25 30 35 40 ( 8
] ( 6
] ( 4
] ( 2
] (
] Frequency [%] Energy savings (range) wrt FC [%] B+B GrF GrE
By design GrF cannot be any worse that using all of the cache.
15
15 /23
16
16 /23
We investigate the performance of the proposed
Number of sensors Size of cache (number of cached queries) Query size (wrt total area) Validity time (of cached results)
17
17 /23
5 10 15 20 25 5 4 3 2 1 Energy cost loss wrt OPT [%] Number of sensors (x 1,000) B+B FC GrF GrE 1 10 100 1000 10000 5 4 3 2 1 Number of states explored Number of sensors (x 1,000) GrE GrF B+B OPT
18
18 /23
5 10 15 20 500 400 300 200 100 Energy cost loss wrt OPT [%] Cache size [# Queries] B+B FC GrF GrE 1 10 100 1000 10000 500 400 300 200 100 Number of states explored Cache size [# Queries] GrE GrF B+B OPT
19
19 /23
10 20 30 40 50 60 70 16 4 1 0.25 0.01 Energy cost loss wrt OPT [%] Query size [% of total area] B+B FC GrF GrE 1 10 100 1000 10000 16 4 1 0.25 0.01 Number of explored states Query size [% total area] GrE GrF B+B OPT
20
20 /23
2 4 6 8 10 12 10 15 20 25 30 35 40 45 50 Energy cost loss wrt OPT [%] Validity time [number of timestamps] B+B FC GrF GrE 1 10 100 1000 10000 10 15 20 25 30 35 40 45 50 Number of states explored Validity time [# timestamps] GrE GrF B+B OPT
21
21 /23
The cached query selection, query clipping and sub-
Although a query cost model is needed, our proposal
If nothing can be done your best shot is to use all of
22
22 /23
The Branch-and-Bound heuristic :
Finds a “query plan” orders of magnitude faster
Is typically less than 2% more expensive than the
Is robust with respect to a number of different
Next stop: Aggregation queries …
23
23 /23