a semantic caching method based on linear constraints

Post on 22-Feb-2016

43 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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). - PowerPoint PPT Presentation

TRANSCRIPT

A Semantic Caching MethodBased 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) 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

Data Caching (2)

Database

ServerDBMS

ClientModule

Query

Query

Result

Result

Result

LocalCache

Data Caching (3)

Database

ServerDBMS

ClientModule

Query

ReminderQuery

Result

Result

LocalCache

CacheInformation

Examination

ProbeQueryResult

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 (D

ar, Franklin, Srivastava et al.)– Predicate caching (Keller and Basu)– View caching (Roussopoulos et al.)

Semantic Caching (2) Semantic caching based on rectlinear region

age

salaryQ1: SELECT *

FROM Employee WHERE age 30 AND age 40 AND salary 2000 AND salary 3000

30 40

3000

2000Q2: SELECT * FROM Employee WHERE age 35 AND age 50 AND salary 2500 AND salary 4000

4000

50stored into local cache

Semantic Caching (2) Semantic caching based on rectlinear region

age

salaryQ1: SELECT *

FROM Employee WHERE age 30 AND age 40 AND salary 2000 AND salary 3000

30 40

3000

2000Q2: SELECT * FROM Employee WHERE age 35 AND age 50 AND salary 2500 AND salary 4000

4000

50

probequery

reminderquery

Semantic Caching (3)

age

salary

Probe Query SELECT *FROM EmployeeWHERE age 35 AND age 40AND salary 2500 AND salary 3000

30 40

3000

2000

Reminder Query SELECT *FROM EmployeeWHERE (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

probequery

reminderquery

Outline

Background Our Approach

– An example– Constraint data model

Algorithms Future work and conclusion

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

An Example (1)

Q1SELECT name, yearFROM UsedCarWHERE displacement 1500 AND price 8000

name maker year displacement price tax …Maxima Nissan 1998 1800 12,000 800 …Mirage Mitsubishi 1997 1200 5,000 250 …J etta Volkswagen 1994 1600 6,000 300 …

… … … … … … …

q1

(displacement 1500) (price 8000)

client retieves all base tuples which satisfy q1

An Example (1)

Q1SELECT name, yearFROM UsedCarWHERE displacement 1500 AND price 8000

q1

(displacement 1500) (price 8000)

client retieves all base tuples which satisfy q1

tid constraint tuple time t1 (displacement 1500) (price 8000) T1

cache-info

client stores a tuple in cache-infoto describe obtained tuples

An Example (2)

Q2SELECT name, price, taxFROM UsedCarWHERE displacement 1200AND price + tax 10000

q2

(displacement 1200) (price + tax 10000)

tid constraint tuple time t1 (displacement 1500) (price 8000) T1

cache-info

client examines cache-infoto check the availability of tuples

An Example (3)Probe Queryq1 q2 = ((displacement 1500) (price 8000)) ((displacement 1200) (price + tax 10000)) = (displacement 1500) (price 8000) (price + tax 10000)

8000price

tax

An Example (3)Probe Queryq1 q2 = ((displacement 1500) (price 8000)) ((displacement 1200) (price + tax 10000)) = (displacement 1500) (price 8000) (price + tax 10000)

10000

100008000price

tax

An Example (3)Probe Queryq1 q2 = ((displacement 1500) (price 8000)) ((displacement 1200) (price + tax 10000)) = (displacement 1500) (price 8000) (price + tax 10000)

10000

100008000price

tax

semantic region for the probequery

An Example (4)Probe Queryq1 q2 = (displacement 1500) (price 8000) (price + tax 10000)

Reminder Queryq1 q2 = ((displacement < 1500) (price > 8000)) ((displacement 1200) (price + tax 10000))

tid constraint tuple time t1 (displacement 1500) (price 8000) T1 t2 (displacement 1200) (price + tax 10000) T2

cache-info

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.

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 a1x1 + ... + apxp a0

– ai: integer {=, , <, , >, }

Constraint relation r = {1, ..., M} i : constraint k-tuple

– Also represented as r = 1 ... M (disjunctive normal form)

Orthographic Partitioning

Proposed by Grumbach et al. Partitions a constraint tuple into

independent components Reduces computational complexity

tid op1 op2 time t1 (displacement 1500) (price 8000) T1 t2 (displacement 1200) (price + tax 10000) T2

tid constraint tuple time t1 (displacement 1500) (price 8000) T1 t2 (displacement 1200) (price + tax 10000) T2

Outline Background Our Approach Algorithms

– Cache examination– Overlap computation– Cache replacement

Future work and conclusion

Cache Examination Algorithm Checks the availability

of cached base tuples Generates a probe

query and a reminder query

Takes orthographic partitioning into consideration

t1

t2

q

Cache Examination Algorithm(1) Checks the availability

of cached base tuples Generates a probe

query and a reminder query

Takes orthographic partitioning into consideration

t1

t2

q

probe query

reminderquery

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 as

pq := pq1 ... pqn

– The reminder query is generated as rq := q pq

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

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.

Outline Background Our Approach Algorithms

– Cache examination– Overlap computation– Cache replacement

Future work and conclusion

Future Work

Efficient calculation of overlaps– Use of indexes– Minimum bounding box (MBB)-based

approach Cache Replacement algorithm

– Efficient replacement algorithm Simulation-based Evaluation

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

top related