1 / 30

A Semantic Caching Method Based on Linear Constraints

A Semantic Caching Method Based on Linear Constraints. Yoshiharu Ishikawa and Hiroyuki Kitagawa University of Tsukuba {ishikawa,kitagawa}@is.tsukuba.ac.jp. Outline. Background Data caching Semantic caching Our Approach Algorithms Future work and conclusion. Data Caching (1).

barton
Download Presentation

A Semantic Caching Method Based on Linear Constraints

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Semantic Caching MethodBased 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 intolocal cache • Uses cached results for later queries: improves response time • Based on the notion oftemporal locality • Used in various situations: • Client-server database environments • Data warehousing • has relationship with materialized view

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

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

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

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

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

  9. Semantic Caching (3) Probe Query SELECT * FROM Employee WHERE age  35 AND age  40 AND salary  2500 AND salary  3000 salary reminder query 4000 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) 3000 probe query 2000 30 40 50 age

  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 onlinear constraints • Assumption: a query condition is aconjunctionof (in)equality formulas • Caches retrievedbase tuples • Maintains compactconstraint relationsto describe cached base tuples

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

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

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

  15. An Example (3) Probe Query q1q2= ((displacement  1500)  (price  8000))  ((displacement  1200)  (price + tax  10000)) = (displacement  1500) (price  8000) (price + tax  10000) tax 8000 price

  16. An Example (3) Probe Query q1q2= ((displacement  1500)  (price  8000))  ((displacement  1200)  (price + tax  10000)) = (displacement  1500) (price  8000) (price + tax  10000) tax 10000 8000 10000 price

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

  18. An Example (4) Probe Query q1q2= (displacement  1500)  (price  8000)  (price + tax  10000) Reminder Query q1q2= ((displacement < 1500)  (price > 8000))  ((displacement  1200)  (price + tax  10000)) cache-info

  19. Constraint Data Model • Incorporates the notion ofconstraintsdirectly into the data model • Can representinfinite informationin 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 constrainta1x1 + ... + apxp a0 • ai: integer •  {=, , <, , >, } • Constraint relationr = {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 t2 t1 q

  24. Cache Examination Algorithm(1) probe query • Checks the availability of cached base tuples • Generates a probe query and a reminder query • Takes orthographic partitioning into consideration t2 reminder query t1 q

  25. Cache Examination Algorithm(2) • The brief idea • For each tuple i in cache-info, compute pqi, its overlap with query q • The probe query is generated aspq := pq1... pqn • 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 thebasic feasible solutionsfrom 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

More Related