**2. Semantic cache query processing**

In general research a semantic cache system can be grouped into two parts i) cache management and ii) query processing. Strategies for data management, replacing, coalescing, and indexing results of previously evaluated queries are mainly the part of semantic cache management. Query processing involves techniques that compute available and unavailable data from a semantic cache by performing some sort of reasoning over

Semantic Cache Reasoners 83

Previous surveys (Bashir M. F. and Qadir M. A., 2006a), (Ahmad, M and Qadir, M.A., 2008), (Jónsson B. Þór et al., 2006), (Hao X et al., 2005), (Halevy, A.Y., 2001), (Makki K. S and Andrei S, 2009) conducted over semantic cache query processing identified two main parameters for evaluation i.e. Maximum Data Retrieval (MDR) and fast query processing. Quantification of the MDR was not given in those surveys. Here we quantify it with the test, data from server (**Ds**) intersection data from cache (**Dc**) should be empty set i.e. **Ds ∩ Dc = Φ.**  In general any technique which retrieves maximum possible or complete results from local cache in tractable time with this given quantification is said to be an efficient semantic cache

A select-project query is a tuple < QUA, QUR, QUP,QUD>, where QUA is *Select Clause* of query which contains projected attributes. QUR is the *From Clause* which contains relation of a database D, from which data is to be retrieved. QUP is *Where Clause* which contains conjunctive or disjunctive compare predicates, a compare predicate is of the form *P = a op c*, where *a A {Attributes Set}, op {* ,,,, *}, c* is a constant in a specific domain (Ren et al., 2003), QUD is the *resultant data* of this query. A query can be represented as *π QUA σ QUP*

A query that only request a key attribute of a relation from a remote server to extract known available data from cache is called an amending query. When we know that some data is available in semantic cache but could not extract it precisely. Than we request the server for a key attribute for a user query and extract cached attributes (data) against those keys from cache. Requesting only keys require less computation on database server and low

Consider the following employee database information provided in example 1 below, which shall be used throughout evaluation in this chapters. The semantic cache model we follow is similar to the relational database model. The basic building blocks of the relational model are attributes (columns), rows (tuple), tables (relations) and relation schema. The schema defines the relations and the attributes with their data type in each relation. A row or a tuple

Consider an employee database with a relation name *Emp (Empid, Ename,Department, Age, Salary,Exp)*. The domain of the *Age, Salary*, *Department* and *Exp* attributes of *Emp* are {20,…,100},{0.1K,…,1K,…15K},{CS, EE, BI, BA},{1,..,50} respectively as shown in Figure 2.

Work on query processing over semantic cache is mainly classified in query intersection (Lee et al., 1999), query trimming (Keller A.M. and Basu J., 1996),(Ren, Q et al., 2003), answering queries using views (Levy A.Y et al., 1996), (Duschka O.M. and Genesereth M.R.

Also suppose that a cache already has following cached queries shown in Figure 3.

**2.1 Semantic cache query processing criteria** 

query processing technique.

*(QUR)* in relational algebra.

bandwidth over network, in general.

is a set of attribute's instances.

**3. Query processing techniques** 

**2.4 Example 1** 

**2.3 Amending query** 

**2.2 Query** 

semantic descriptions. Also query processing technique handles local query execution, retrieval of unavailable data from a remote server and formulation of the end results. In this chapter we focus on semantic cache query processing.

At finer granularity semantic cache is a collection of semantic regions or semantic segments. Associated semantics for a cached query, which is a query specification (Lee et al., 1999) are stored in semantic cache along with resultant data is called a semantic region (Dar et al., 1996) or semantic segment (Ren et al., 2003).

Fig. 1. Relationship between Cached Query (QC) and User Query (QU).

Formal definition of semantic segment can be seen in (Ren et al., 2003). A query processing technique can perform reasoning over semantic segments to determine whether cached data fully or partially or do not contributes to an incoming query. If the incoming query is fully answerable from a semantic cache, then no communication with the server is required. Similarly a partial answer to a query will reduce the amount of data retrieved from the server.

In case of a partial answer, the user query is trimmed into two disjoint sub queries (Keller A.M. and Basu J., 1996): the query executed locally called Probe Query (ProbQ) and the query sent to the server named Remainder Query (RemQ) (Dar et al., 1996). The previous literature (Ren, Q et al., 2003),(Dar et al., 1996),(Lee et al., 1999),(Godfrey P. and Gryz J., 1997),(Keller A.M. and Basu J., 1996) shows that this trimming is performed on the basis of relationship between the content of a semantic segment and the result required by an incoming query. Possible cases of the relationship between the incoming query and the semantics stored in the cache (as reported in the literature) is shown in Figure 1. White boxes represent previously stored query results and gray boxes shows incoming user queries. In Figure 1 rows (tuples) are represented horizontally and columns (attributes) are vertically and only select-project queries are considered. In each case a user query overlaps semantic cache region in a certain way. Case 2 depicts a horizontal partition in which some part of the incoming query tuples satisfied by cache semantics. Where in case 3, a projection of the query is available in cache and some attributes are missing, this situation is called a vertical partition. This figure represents that a partial answer is possible in case 2,3 and 4, where a user query can be fully answered from the cache in case 1. This figure is used to evaluate a semantic cache query processing scheme, too, i.e. whether a scheme incorporates all the cases or not. We argue that due to this misleading diagram, the missing implicit semantics are not being considered in the previous query processing techniques. Therefore, in this thesis we have adopted a new way of comparing the semantics of a user query and the cache semantics in the coming sections.t)

82 Semantics – Advances in Theories and Mathematical Models

semantic descriptions. Also query processing technique handles local query execution, retrieval of unavailable data from a remote server and formulation of the end results. In this

At finer granularity semantic cache is a collection of semantic regions or semantic segments. Associated semantics for a cached query, which is a query specification (Lee et al., 1999) are stored in semantic cache along with resultant data is called a semantic region (Dar et al.,

Formal definition of semantic segment can be seen in (Ren et al., 2003). A query processing technique can perform reasoning over semantic segments to determine whether cached data fully or partially or do not contributes to an incoming query. If the incoming query is fully answerable from a semantic cache, then no communication with the server is required. Similarly a partial answer to a query will reduce the amount of data retrieved from the

In case of a partial answer, the user query is trimmed into two disjoint sub queries (Keller A.M. and Basu J., 1996): the query executed locally called Probe Query (ProbQ) and the query sent to the server named Remainder Query (RemQ) (Dar et al., 1996). The previous literature (Ren, Q et al., 2003),(Dar et al., 1996),(Lee et al., 1999),(Godfrey P. and Gryz J., 1997),(Keller A.M. and Basu J., 1996) shows that this trimming is performed on the basis of relationship between the content of a semantic segment and the result required by an incoming query. Possible cases of the relationship between the incoming query and the semantics stored in the cache (as reported in the literature) is shown in Figure 1. White boxes represent previously stored query results and gray boxes shows incoming user queries. In Figure 1 rows (tuples) are represented horizontally and columns (attributes) are vertically and only select-project queries are considered. In each case a user query overlaps semantic cache region in a certain way. Case 2 depicts a horizontal partition in which some part of the incoming query tuples satisfied by cache semantics. Where in case 3, a projection of the query is available in cache and some attributes are missing, this situation is called a vertical partition. This figure represents that a partial answer is possible in case 2,3 and 4, where a user query can be fully answered from the cache in case 1. This figure is used to evaluate a semantic cache query processing scheme, too, i.e. whether a scheme incorporates all the cases or not. We argue that due to this misleading diagram, the missing implicit semantics are not being considered in the previous query processing techniques. Therefore, in this thesis we have adopted a new way of comparing the semantics of a user query and

chapter we focus on semantic cache query processing.

Fig. 1. Relationship between Cached Query (QC) and User Query (QU).

1996) or semantic segment (Ren et al., 2003).

the cache semantics in the coming sections.t)

server.
