Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Semantic Caching Method Based on Linear Constraints Yoshiharu Ishikawa and Hiroyuki Kitagawa University of Tsukuba

Similar presentations


Presentation on theme: "A Semantic Caching Method Based on Linear Constraints Yoshiharu Ishikawa and Hiroyuki Kitagawa University of Tsukuba"— Presentation transcript:

1 A Semantic Caching Method Based on Linear Constraints Yoshiharu Ishikawa and Hiroyuki Kitagawa University of Tsukuba {ishikawa,kitagawa}@is.tsukuba.ac.jp

2 Outline _ Background –Data caching –Semantic caching _ Our Approach _ Algorithms _ Future work and conclusion

3 Data Caching (1) _ Stores a query result into local cache _ Uses cached results for later queries: improves response time _ Based on the notion of temporal locality _ Used in various situations: –Client-server database environments –Data warehousing –has relationship with materialized view

4 Data Caching (2) Database Server DBMS Client Module Query Result Local Cache

5 Data Caching (3) Database Server DBMS Client Module Query Reminder Query Result Local Cache Information Examination Probe Query Result

6 Semantic Caching (1) _ Based on semantic locality (in addition to temporal locality) –Similar objects tend to be referenced together _ Related work –Semantic caching based on rectlinear region (Dar, Franklin, Srivastava et al.) –Predicate caching (Keller and Basu) –View caching (Roussopoulos et al.)

7 Semantic Caching (2) _ Semantic caching based on rectlinear region age salary Q1: SELECT * FROM Employee WHERE age  30 AND age  40 AND salary  2000 AND salary  3000 3040 3000 2000 Q2: SELECT * FROM Employee WHERE age  35 AND age  50 AND salary  2500 AND salary  4000 4000 50 stored into local cache

8 Semantic Caching (2) _ Semantic caching based on rectlinear region age salary Q1: SELECT * FROM Employee WHERE age  30 AND age  40 AND salary  2000 AND salary  3000 3040 3000 2000 Q2: SELECT * FROM Employee WHERE age  35 AND age  50 AND salary  2500 AND salary  4000 4000 50 probe query reminder query

9 Semantic Caching (3) age salary Probe Query SELECT * FROM Employee WHERE age  35 AND age  40 AND salary  2500 AND salary  3000 3040 3000 2000 Reminder Query SELECT * FROM Employee WHERE (age  35 AND age  40 AND salary  3000 AND salary  4000) OR (age  40 AND age  50 AND salary  2500 AND salary  4000) OR (age  40 AND age  50 AND salary  3000 AND salary  4000) 4000 50 probe query reminder query

10 Outline _ Background _ Our Approach –An example –Constraint data model _ Algorithms _ Future work and conclusion

11 Our Approach _ A new approach to semantic caching –Generalization of rectlinear region-based approach –Based on linear constraints _ Assumption: a query condition is a conjunction of (in)equality formulas _ Caches retrieved base tuples _ Maintains compact constraint relations to describe cached base tuples

12 An Example (1) Q1 SELECT name, year FROM UsedCar WHERE displacement  1500 AND price  8000 q 1 (displacement  1500)  (price  8000) client retieves all base tuples which satisfy q 1

13 An Example (1) Q1 SELECT name, year FROM UsedCar WHERE displacement  1500 AND price  8000 q 1 (displacement  1500)  (price  8000) client retieves all base tuples which satisfy q 1 cache-info client stores a tuple in cache-info to describe obtained tuples

14 An Example (2) Q2 SELECT name, price, tax FROM UsedCar WHERE displacement  1200 AND price + tax  10000 q 2 (displacement  1200)  (price + tax  10000) cache-info client examines cache-info to check the availability of tuples

15 An Example (3) Probe Query q 1  q 2 = ((displacement  1500)  (price  8000))  ((displacement  1200)  (price + tax  10000)) = (displacement  1500)  (price  8000)  (price + tax  10000) 8000 price tax

16 An Example (3) Probe Query q 1  q 2 = ((displacement  1500)  (price  8000))  ((displacement  1200)  (price + tax  10000)) = (displacement  1500)  (price  8000)  (price + tax  10000) 10000 8000 price tax

17 An Example (3) Probe Query q 1  q 2 = ((displacement  1500)  (price  8000))  ((displacement  1200)  (price + tax  10000)) = (displacement  1500)  (price  8000)  (price + tax  10000) 10000 8000 price tax semantic region for the probe query

18 An Example (4) Probe Query q 1  q 2 = (displacement  1500)  (price  8000)  (price + tax  10000) Reminder Query  q 1  q 2 = ((displacement 8000))  ((displacement  1200)  (price + tax  10000)) cache-info

19 Constraint Data Model _ Incorporates the notion of constraints directly into the data model _ Can represent infinite information in terms of finite representation _ A constraint data model is a combination of –Base data model: relational data model, datalog, etc. –Constraint domain: dense order, linear arithmetic, polynomials, etc.

20 Definition of the Data Model _ Constraint k-tuple  =  1 ...   N –  i : constraint (equality or inequality constraint) –In our case, linear constraints are used _ Linear constraint a 1 x 1 +... + a p x p  a 0 –a i : integer –   {=, ,,  } _ Constraint relation r = {  1,...,  M } –  i : constraint k-tuple –Also represented as r =  1 ...   M (disjunctive normal form)

21 Orthographic Partitioning _ Proposed by Grumbach et al. _ Partitions a constraint tuple into independent components _ Reduces computational complexity

22 Outline _ Background _ Our Approach _ Algorithms –Cache examination –Overlap computation –Cache replacement _ Future work and conclusion

23 Cache Examination Algorithm _ Checks the availability of cached base tuples _ Generates a probe query and a reminder query _ Takes orthographic partitioning into consideration t1t1 t2t2 q

24 Cache Examination Algorithm(1) _ Checks the availability of cached base tuples _ Generates a probe query and a reminder query _ Takes orthographic partitioning into consideration t1t1 t2t2 q probe query reminder query

25 Cache Examination Algorithm(2) _ The brief idea –For each tuple i in cache-info, compute pq i, its overlap with query q –The probe query is generated as pq := pq 1 ...  pq n –The reminder query is generated as rq := q   pq

26 Overlap Computation _ Requirement: delete redundant constraints from the overlap –e.g. (age > 30)  (age  50)  (age > 40) (age > 40)  (age  50) _ For this purpose, we applied a technique found in linear programming –Calculate all of the basic feasible solutions from the given constraints –If a solution does not exist, there is no overlap. –Resulting constraint is easily calculated

27 Cache Replacement _ A simple reference count-based algorithm –Sets a counter for each base tuple –If cache is full, it uses select-victim() function to select victims for the replacement (definition of the select-victim function is the future work). –If a reference counter becomes 0, its corresponding base tuple is deleted from the cache.

28 Outline _ Background _ Our Approach _ Algorithms –Cache examination –Overlap computation –Cache replacement _ Future work and conclusion

29 Future Work _ Efficient calculation of overlaps –Use of indexes –Minimum bounding box (MBB)-based approach _ Cache Replacement algorithm –Efficient replacement algorithm _ Simulation-based Evaluation

30 Conclusion _ A new approach to semantic caching –linear constraint-based approach _ A naive algorithm to compute a probe query and a reminder query –Overlap computation is the key factor –An overlap computation algorithm based on linear programming _ Proposal of replacement algorithm


Download ppt "A Semantic Caching Method Based on Linear Constraints Yoshiharu Ishikawa and Hiroyuki Kitagawa University of Tsukuba"

Similar presentations


Ads by Google