signature=438c4078a5ce8398d2ffb7f6b595c2f8,Signature file based semantic caching of queries

The present invention relates to online information retrieval systems (e.g. internet/www, intranet), and more particularly to signature file based semantic caching of queries.

In client-server information systems, local client memory is largely used to cache data and to minimise future interaction with the servers. This data caching has a particular importance on the Web where the network traffic and slow servers can lead to long delays in the answer delivery. As standard page-based caching is improper on the Web and tuple-based caching has certain limitations, much effort has been spend to cache user queries and answers for possible future reuse (see Y. Arens and C. A. Knoblock, Intelligent Caching: Selecting, Representing, and Reusing Data in an Information Server, In Proc. CIKM'94 Conference, Gaithersburg, Maryland, pp. 433-438, 1994; S. Dar, M. J. Franklin, B. Jonsson, D. Srivastava, M. Tan, Semantic Data Caching and Replacement, In Proc 22nd VLDB Conference, Bombay, India, pp. 330-341, 1996; P. Godfrey and J.

Gryz, Semantic Query Caching For Heterogeneous Databases,. In Proc. 4th KRDB Workshop "Intelligent Access to Heterogeneous Information", Athens, Greece, pp.6.1-6.6, 1997).

Query caching takes a particular advantage when the user refines a query quite often, for example, by adding or removing a keyword. In this case, many of answer tuples may already be cached and can be delivered to the user right away.

A Web-based query system contacts heterogeneous distributed data repositories, invokes so-called wrappers to convert user queries into the target query language, and controls the data flow from these servers (see Y. Papakonstantinou, H. Garcia-Molina, J. Ullman, MedMaker: A Mediation System Based on Declarative Specifications, in Proc ICDE'96 Conference, pp.132-141, 1996; and Ch. Reck and B. K·onig-Ries, An Architecture for Transparent Access to Semantically Heterogeneous Information Sources, In Proc. Cooperative Information Agents, Lect. Note Comp. Science, Vol. 1202, 1997). As data are usually transferred over the network in HTML format, the wrappers also extract answer tuples from the retrieved HTML files before the final answer is reported to the user (and stored in the cache).

A typical Web query is a conjunction of terms. Each term in the query is a keyword, possibly negated with the operator NOT, and applied to one or more attributes (title, author, etc.). In most Web servers, the operator NOT is equivalent to AND NOT to force a query to contain at least one non-negated term. Semantic caching.

Semantic caching manages the client cache as a collection of semantic regions; access information is managed and cache replacement is performed at the unit of semantic regions (see Dar et al.). Semantic regions group together semantically related documents covered, for example, by a user query.

In any solution to semantic caching, each semantic region has a constraint formula which describes its contents, a counter of tuples in the contents, a pointer to the set of actual tuples in the cache, and the additional information that is used by the replacement policy to rank the regions. Like a query, any region formula is a conjunction of terms.

When a query is posed at a client, it is split into two disjoint pieces : (1) the portion of the answer available in the local cache, and (2) a remainder query, which retrieves any missing tuples in the answer from the server. If the remainder query is not null (i.e., the query covers parts of the information space that are not cached), the remainder query is sent to the server and processed there (see U. M. Borghoff, R. Pareschi, F. Arcelli, F. Formato, Constraint-Based Protocols for Distributed Problem Solving, In Science of Computer Programming, vol. 30, 201-225, 1998).

Although a number of important principles of query caching are discussed in the abovementioned Dar et al., Godfrey et al. and Arens and Knoblock articles, none provides any efficient method for the query evaluation against the cache items. Moreover, the query evaluation is reduced in the abovementioned Godfrey et al article to a Datalog query evaluation, which may be computationally hard.

The present invention provides a method carried out in an information processing system, the systems comprising a processor, memory, and a user interface, a predetermined plurality of locations in said memory defining a cache, said cache comprising one or more semantic regions, comprising: (a) receiving a query Q input by a user via the user interface, the query having a corresponding query signature SQ; (b) in dependence upon said query signature SQ, returning as an answer corresponding to said query Q (i) the contents of one or more of said regions, or (ii) the contents of one or more of said regions together with an remainder answer obtained from a sewer in response to a query remainder derived from said query Q.

The invention further provides a programmable information processing system when suitably programmed for carrying out the method of any of the preceding claims, the system including a processor, and a memory, and a user interface, the processor being coupled to the memory, user interface, and being operable in conjunction therewith for executing instructions corresponding to the steps of said method(s).

The invention provides a new mechanism for caching Web queries. It is based on so-called signature files and allows for efficient query evaluation, which is linear in the number of cache items. According to embodiments of the invention, each semantic region in the cache is associated with a signature. For a user.query, the signature is created in a similar way and verified against the region signatures stored in the cache. The proposed caching mechanism includes a procedure that identifies all cache items qualified for the query, i.e., it detects which cache items can be re-used immediately, and which missing information has to be requested from the servers.

This mechanism has three main advantages. First, it processes both critical cases in the same elegant way, 1) when a query is contained in the cache, or 2) when it intersects some regions. As a result, the proposed mechanism avoids most cases of tuple duplications, and has a moderate storage requirement. Second, it supports efficient reporting of partial answers and generating of query remainders. Finally, it provides a simple solution for the region coalescing and the replacement policy.

Embodiments of the invention will now be described, by way of example, with reference to the accompanying drawings, in which: Figure 1 schematically illustrates a network of machines suitable as a basis for implementing the invention; Figure 2 shows (a) Region signature construction, and (b) Sample queries and their signatures; Figure 3 depicts a suitable cache architecture; Figure 4 illustrates semantic containment cases - (a) Single region containment; (b) multiple region containment;

(c) single query containment; and (d) multiple query containment; Figure 5 depicts region coalescing examples - (a) Query Q=d is issued, (b) Regions coalesced after the query, (c) Query b ANd d ANd f is issued, and (d) Regions updated after the query; Figures 6(a) to 6(c) illustrate the processing steps for implementing caching according to a first technique; Figure 7 shows a semantic intersection example; Figures 8(a) to 8(d) illustrate the processing steps for implementing caching according to a second technique; and Figure 9 illustrates region coalescing for the semantic intersection - (a) Queryc ANd d is issued, and (b) after the query. 1. Hardware and infrastructure

It will be appreciated that the present invention may be implemented using conventional computer network technology, either by means of an intranet or, more suitably, a internet. The invention may implemented using conventional WWW web browser software (e.g. Netscape) providing cross-platform communication and document transfer over the internet. This is schematically illustrated in Fig. 1. It will be appreciated that each machine 22, 24, 26 forming part of the network 21 may be a PC running Windows TM , a Mac running MacOS, or a minicomputer running UNIX, which are well known in the art. For example, the PC hardware configuration is discussed in detail in The Art of Electronics, 2nd Edn, Ch. 10, P. Horowitz and W. Hill, Cambridge University Press, 1989.

However, it will be appreciated that the invention may be implemented using different system configurations:, for example, EP-A-772,857 and EP-A- (corresponding to US application S.N. 08/668,704).

Upon request of a user at machine 22 a document or other information (e.g. answer to query) stored on machine 26 may be retrieved and sent from machine 26 over the internet, via any number of intermediate machine 24 to machine 22. As is well known, the document may be retrieved using as a unique identifier its World Wide Web URL, obtained, for example using a suitable query input to a search engine. 2.1 Signature files and cache architecture

Signature files were originally designed for the retrieval of full-text fragments containing query words (see C. Faloutsos, Signature files: Design and Performance Comparison of Some Signature Extraction Methods, In Proc. SIGMOD'85 Conference, pp. 63-82, 1985; and C. Faloutsos and S. Christodoulakis, Signature Files: An Access Method for Documents and Its Analytical Performance Evaluation, In ACM Trans. of Information Systems, Vol. 2, n. 4, pp. 267-288, 1984). With the superimposed coding which is the most widely known, each semantic region is associated with a formula in the conjunctive form. Each term in region formula is assigned with a term signature which is a binary sequence of ones and zeros. The region signature is generated by superimposing (bit-wise OR-ing) all term signatures generated from the region formula.

Figure 2 shows (a) Region signature construction, and (b) Sample queries and their signatures.

Figure 2(a) shows the signature generation for the semantic region "query ANd caching". For a user query, which is also a conjunction, all terms are assigned with signatures and superimposed into a query signature in the way similar to cache regions. Then, the query signature is matched against each region signature in the signature file to provide a partial answer and construct the query remainder.

Two different caching techniques set out herein work with different semantic relations between semantic regions and the query. The first caching technique copes with semantic containment between the query and a region, when one of them contains other. The second caching technique described in Section 4 extends the processing to more frequent and complex cases of semantic intersection, when neither region contains the query nor vice versa.

We begin with the semantic containment which consists of three cases. Query Q is equivalent to a region R if their formulas are equivalent. A region R contains query Q if the query formula can be obtained from the region formula by dropping one or more terms. In this case, the answer to the query is a proper subset of the region contents. Inversely, semantic region R is contained in query Q if the region formula can be obtained from the query by dropping one or more query terms. Also, the region containment means that the answer is a superset of the region contents. In any of the three cases described above, the region R is qualified for query Q.

Let SQ and SR denote the query signature and a region signature, respectively. With the bit-wise comparison of the signatures, the semantic containment is detected as follows:

Region containment, SQ SUBSET SR: for each bit in the query signature set to one, the corresponding bit in the region signature is also set to one (query 2 in Figure 2(b)).

Equivalence, SQ = SR : the region and query signatures have the same bits set to one (query 3 in Figure 2(b)).

Query containment, SQ SUPERSET SR: for each bit in the region signature set to one, the corresponding bit in the query signature is also set to one (query 4 in Figure 2(b)).

A signature file eliminates most, but not all of the regions which are not qualified for the query. The last query in Figure 2(b) is a false drop. False drops are semantic regions which the signatures are qualified for the query, but they don't. Indeed, if terms "ski" and "resort" are assigned with signatures "0110 0000 1000" and "0000 0110 0001", respectively, then the signature of query "ski ANd resort" is "0110 0110 1001", and, therefore, equivalent to the signature of the region "query ANd caching".

False drops are eliminated by further comparing the query with the regions, but if they are numerous, the performance degrades. To minimise the false drop probability, the expected number of zeros and ones in a signature must be the same (Faloutsos and Christodoulakis). Then, for the same number of distinct keywords in a region or query formula, when the length of the signatures increases, the density of ones in the signatures decreases, and the chance of getting false drops will decrease correspondingly. However, it will increase the storage overhead. If the signature length is F bits and t is the maximal number of terms in the query, the optimal number kopt of bits set to one in a term signature (according to the uniform probability distribution) is "(1)" kopt = (F . In 2)/t

Cache organisation. To process a query faster, the cache architecture according to embodiments of the present invention maintains region signatures separately from region contents (see Figure 3). Besides a signature, each entry (region) in the signature part contains the region formula, the counter of tuples, the link to the corresponding region contents and the value of the replacement function. Qualified regions are detected in the signature part. Once a semantic region is qualified for a full or partial answer, tuples stored in the region contents and matching the query are reported to the user.

Negation. Any region formula contains keywords as well as their negations. To provide a smooth processing for queries with negations, signatures for a keyword and its negation can be related. A negated term can be assigned with a signature which is a bit-wise negation of the basic term signature. However, as the number k of bits set to one in a term signature is much less then the signature length F, this would result in F-k bits set to one in the negated term signature. Therefore, this solution would increase considerably the false drop probability for any region which formula contains the negated term. To avoid this problem to happen, a keyword and its negation (and assign their signatures) are treated as two independent terms, with k bits set to one in any signature. 3. Simple caching technique

The first technique processes three cases of the semantic containment, namely, (1) equivalence, (2) query containment, and (3) region containment. If the query is equivalent to a region in the cache, the query answer coincides with the region contents. If a region contains the query, the complete answer can be also produced from the region contents, with the query formula used as a filter. Moreover, if two or more regions contain the query, any of them can produce the answer. To reduce the filtering overhead, the algorithm selects and filters the region whose contents has the least number of tuples. In the case of region containment, the algorithm extracts a partial answer from the region contents and generates the query remainder which is sent to the server, If several regions are contained in the query, any or all of them can produce the partial answer.

As the number of such regions can be large, the algorithm selects top m regions with the maximal number of tuples.

If no semantic containment is detected, the cache is not used and the query is sent to the server. When the answer is received, a new cache region corresponding to the query is created. If the cache has no free space for the region, it must discard one or several regions from the cache, which are the least valuable for future reuse. As the basic replacement strategy, we use the LRU ("least recently used") strategy. The strategy is appropriate for the Web, where the search is coupled with the navigation and discovery, and a new query often is a refinement of the previous query.

With the algorithm framework described above, three important issues require further analysis, namely, the construction of region remainders, region coalescing and cache region replacement. 3.1 Constructing query remainders

Assume that m semantic regions, R1, ..., Rm, are contained in the query. Although the query remainder Qr can be constructed as Qr = Q - R1 ... - Rm = Q ANd NOt R1 ANd ... ANd NOt Rm,such a constraint formula, after simplification, can contain disjunctions and may not be allowed for a server which accepts conjunctive queries only. For example, for query a and the region a ANd b ANd c (characters from the beginning of the alphabet are used to denote keywords), the constraint formula a - a ANd b ANd c results in the following disjunction formula: a - a ANd b ANd c = a ANd NOt (a ANd b ANd c) = a ANd NOt b OR a ANd NOt c.

To distinguish the regions which drive the query remainder to a conjunctive form from those which do not, it is necessary to introduce the difference measure between the query and region formulas. The difference is defined as the number of terms in the region formula not presented in the query. This definition splits the set of regions R1, ..., Rm into groups, where all regions in a group have l terms of difference from the query, l = 1, 2 .... In the above example, the region formula a ANd b ANd c has a two-term difference from query a. Note, the case l=0 is also possible, it appears when the query and region are equivalent or the region contains the query, and, therefore, the query remainder is null.

The difference measure helps us to establish that the regions with one-term difference preserve the conjunctive form of the query remainder, the following holds: Result 1 (Remainder Construction) Assume the cache contains m regions which the formulas have one-term differences, say a1, a2, .... am, from query formula Q. Then, the query remainder Qr is Q ANd NOt a1 ANd NOt a2 ANd ... ANd NOt am. 3.2 Region coalescing

Figure 4 illustrates semantic containment cases - (a) Single region containment; (b) multiple region containment; (c) single query containment; and (d) multiple query containment.

In the cases of query containment and equivalence, the query remainder is null. Consequently, the query is processed locally and cache contents is kept unchanged. The region providing the query answer updates the corresponding replacement value (see Section 3.3).

In the region containment case, the query remainder is not null, and, moreover, it is a complement to a semantic region R (see Figure 4(a)). When the answer to the query remainder Qr is received, there are two modes to add the answer to the cache. With the no-coalescing strategy, a new cache region is created for the query remainder. With the coalescing strategy, no new region is added; instead, region R's contents is extended with the answer to the remainder and the region formula R is substituted (relaxed) with Q. Both above solutions occupy the same cache space to store tuples, but the coalescing strategy is preferable as it uses only one region instead of two regions with the no-coalescing strategy.

If m semantic regions, R1, ..., Rm, yield the region containment (see Figure 4(b)), the advantage of the coalescing strategy is even larger. The query remainder Qr = Q - R1 - ... - Rm is complement to the union of the regions and the coalescing strategy will keep one region only (with formula Q), instead of regions R1, ..., Rm and the query remainder. As regions R1, ..., Rm can contain tuple duplications, the coalescing strategy provides better storage utilisation in both signature and contents parts of the cache. 3.3 Replacement strategy

As the cache size is limited, the cache may discard the least recently used regions to free space for a new region. The standard LRU strategy, designed for replacement of pages of tuples in the cache, is referring to the same size, and one page or tuple is the replacement unit which can match query or not.

In the query caching, the situation is different. If region R is qualified for the query, involvement of the region in the answer may be different, If the query contains the region (Figure 4(a)), the region contents is completely involved in responding as all tuples from the region contents appears in the answer. By contrast, if the region contains the query (see Figure 4(c)), the region involvement is partial as only some of the region tuples match the query.

Therefore, the replacement function should take into account the region involvement in the query answer. If the region involvement is complete, the new replacement value for the region is "the most recent one", as in the case when the query answer is shipped from the server. If the region involvement is partial, and there are tuples in the region contents not matching the query, the change of the replacement value toward "the most recent one" depends on how large the portion of the matched tuples is. The region involvement can be measured as p = TR/T, where TR is the number of tuples appeared in the query answer and T is the total number of tuples in R's contents.

Without loss of generality, it is assumed that "the most recent value", Vtop, is increasing by one each time a new query is issued. If the current replacement value of region R is VR, VR < Vtop, and the region involvement is p, we calculate a new replacement function as VR' = VR + (Vtop - VR) .p. If p=1, then VR&hairsp; = Vtop. If p=1/2, then VR' = (Vtop + VR)/2. Note, this replacement function can be implemented to any region in the cache, qualified for the query and not. If a region is not qualified for the query and therefore, its involvement p is zero, the region replacement value does not change. Example 1.

Figure 5 depicts region coalescing examples - (a) Query Q=d is issued, (b) Regions coalesced after the query, (c) Query b ANd d ANd f is issued, and (d) Regions updated after the query.

The cache contains three regions with a ANd b ANd c, b ANd d and d ANd NOt a. Figure 5(a) shows the regions with their replacement values (assuming Vtop=6). Assume a new query is d. The second and third regions yield the query containment. As both region formulas differ from the query formula in one word only (b for the second region and NOt a for the third one), the query remainder generated will be d ANd a ANd NOt b. Once the complete answer is produced, the second and third regions and the query reminder are substituted with one region with formula d (Figure 4.b). Its replacement value is Vtop=7.

Assume now that the query is b ANd d ANd f (see Figure 5(c)). Two regions, b ANd d and d ANd NOt a, contain the query. The former is selected to answer to the query as it has less tuples in the contents. Its replacement value is updated (from 3 to 4) accordingly to the portion of tuples matching the query in the region contents. Caching algorithm (1).

Figures 6(a) to 6(c) illustrate the processing steps for implementing caching according to a first technique. Input: cache with semantic regions and query Q. Output: answer to Q and the cache updated. 1. Verify the query signature against all region signatures in the cache (step s1, s2). 2. SQ = SR: If there is a region whose formula is equivalent to the query, return the region contents as the query answer. Update the replacement function value of the region and stop (steps s3 and s4). 3. SQ SUPERSET SR: If one or more regions contain the query, choose the region with the minimal cardinality. Scan tuples in the region contents and return ones matching the query. Update the replacement function value of the region and stop (steps s12 to s15). 4.

SQ SUBSET SRi: If several regions are contained in the query, choose top m regions, R1, ..., Rm, with the maximal cardinality. Return all tuples from the regions contents of R1, ..., Rm, discarding duplications (steps s5 to s11). Construct the query remainder as follows (steps s71 to s77; Fig. 6(b)): Set the query remainder to query Q (step s71). For each region Ri providing the region containment, calculate (step s73) the difference between the region formula and the query. If the difference is one term ai only, constrain the query remainder with NOt ai. Send the query reminder to the server. When the answer is received, replace regions R1, ..., Rm with one region Q. Put Vtop as the replacement value for Q and stop. 5. Otherwise (steps s16 to s20; Fig. 6(c)), send query Q to the server. Once the answer is received, create a new region for Q in the cache.

To free space for the region, remove the regions with the least replacement values, till query Q fits the cache. 4. Advanced caching technique

The caching technique described in the previous section efficiently manages the semantic containment cases. However, it does not manage more frequent but more complex cases of the semantic intersection, when a semantic region can produce a portion of the answer, but it neither contains nor is contained in the query.

Figure 7 shows a semantic intersection example.

Example 2. Assume, the cache contains region R1 with formula " ANd query" and query Q is "optimal ANd query" (see Figure 7(a)). Since there is no containment, Algorithm 1 does not exploit R1 for the partial answer, although the tuples in the region contents matching the formula "optimal ANd query ANd caching" match also the query. Moreover, when Algorithm 1 receives the answer to query Q from the server, it creates a new semantic region R2 with the same formula "optimal ANd query" (see Figure 7(b)). Two semantic regions R1 and R2 contain tuple duplicates, which match their intersection formula "optimal ANd query ANd caching". In other words, in the semantic intersection cases, Algorithm 1 retains a low cache use and a high tuple duplication level.

In this section an advanced caching technique is described which, besides the containment cases, processes the semantic intersection to improve the cache utilisation and reduce the tuple duplications.

Intersection of a semantic region R and query Q is given by intersection of their formula intersection R INTERSECTION Q. Given the region signature SR and the query signature SQ, we use their signature intersection SQ INTERSECTION SR, which is obtained by the bit-wise AND-ing of SQ and SR. Then, for a signature S, the signature cardinality ŠSŠ denotes the number of bits set to one in the signature.

In the semantic intersection of a semantic region R and query Q, we distinguish two main cases: Complement: Q INTERSECTION R = O; the formula intersection is null. For instance, query a ANd b is a complement to the region a ANd NOt b. Consequently, the region contains no tuples to answer to the query. However, in the complement case, the region coalescing is possible. For the query and region above, the coalescing would result in one region with formula a. Intersection: The Q INTERSECTION R NOTEQUAL O; the formula intersection is not null. There are two following sub-cases: Query and region formulas have some common terms appearing in the intersection (for example, region "caching ANd query" and query "optimal ANd query" have term "query" in common). Query and region formulas have no common words.

For instance, region a and query b have no common terms, but their intersection a ANd b is not empty, and, therefore, the region can contribute to the partial answer.

Semantic intersection in signature files. If the query Q and a region R have some common terms, their signatures have bits set to one which correspond to signatures of the common terms. The more terms formulas Q and R have in common, the larger the number of bits jointly set to one, and the semantic intersection of Q and R can be measured by the number ŠSQ INTERSECTION SRŠ of corresponding bits set to one in both signatures. However, this is not always true. For example, for region with formula a and query b, their signature intersection can have no bits set to one, but the region can report to the user the tuples matching the formula b ANd a.

In the remainder of the section, we show how the signature file method allows to quickly detect which regions intersected by the query can contribute to the partial answer and constrain the query remainder. Note that the following discussion about the semantic intersection assumes that no equivalence or query containment is detected in the cache, and, therefore, the query remainder is not null.

Like in the semantic containment, not all of the regions having intersections with the query can contribute to the query remainder, since conjunctive queries are only allowed. To detect which regions can contribute, term differences introduced in Section 3 are again used. Moreover, the Remainder Construction, which was derived for the semantic containment, but can be fully applied to the semantic intersection, is used. That is, if the cache contains m regions which the formulas are not contained in the query Q, but have one-term differences, say a1, a2, ..., am, the query remainder Qr can be constructed as Q ANd NOt a1 ANd NOt a2 ANd ... ANd NOt am.

Example 2 (continued). As region "caching ANd A query" has one-term difference from the query "optimal ANd query", the region can report the portion "optimal ANd query ANd caching" to the user and construct the query reminder "optimal ANd query ANd NOt caching". Similarly, the region a has one-term difference from query b. the portion a ANd b is reported and the query remainder is b ANd NOt a.

This eminent feature of semantic regions with one-term difference from the query in constraining the query remainder results in a double-scan evaluation of the query against the cache contents. The first, fast scan over the region signatures identifies all regions with one-term difference in order to quickly construct the query remainder and produce the first partial answer. The second, slow scan checks if other intersection cases can enrich the partial answer. The two scans over the region signatures differ in the filtering function applied to the region signatures.

Each region R filtered during the first scan should have at most one-term difference from the query. Therefore, if the region signature has ŠSRŠ bits set to one, and its intersection with the query signature has ŠSR INTERSECTION SQŠ such bits, the difference between the two numbers should be at most k bits, where k is the number of bits set to one in a term signature. The following result states this fact explicitly. Result 2 If region R has one-term difference from query Q, then "(2)" ŠSR INTERSECTION SQŠ≥ŠSRŠ -k

The first scan verifies the condition (2) on the region signatures. If the condition holds for a region signature, the region formula is checked for one-term difference. Like in the semantic containment, a false drop happens if condition (2) holds, but the region formula does not provide one-term difference. A number of experiments have been conducted and it has been found that the number of false drops when verifying the condition (2) can be kept small by the appropriate choice of signature file parameters, calculated with the formula (1).

The second scan detects regions which formulas have two and more terms of difference and can not constrain the query remainder. By analogy with one-term difference, a region R which formula has l, l ≥ 2 terms of difference from the query, satisfies the condition "(3)" ŠSR INTERSECTION SQŠ≥ŠSRŠ-k.l However, this condition can not be used in the full extent for the second scan. First, the condition (3) loses its importance for increasing values of k. In fact, a typical Web query or region formula has an average of three or four terms, and the condition (3) is often reduced to a simple ŠSR INTERSECTION SQŠ≥ 0, which would sweep all the region signatures, resulting in the large number of false drops and a high filtering overhead.

Second, regions having two or more terms of difference from the query, usually contributes much less to the answer that regions with one-term difference. Third, the tuples they contribute will anyway be duplicated in the answer to query remainder, as their formulas were not excluded from the remainder.

These arguments are taken into consideration and only two conditions for the second scan considered: ŠSR INTERSECTION SQŠ ≥ ŠSRŠ -2k: this condition fetches mainly the regions with two-term difference from the query. Therefore, some regions having more terms of the difference will not be fetched. ŠSR INTERSECTION SQŠ ≥ 0: all region formulas satisfy this condition; therefore, it yields numerous false drops. However, it retrieves all tuples in the cache matching the query.

In most cases, the first option is preferable as it provides a good tradeoff between the number of false drops and the number of tuples retrieved. The second option can be used if the cache is small or the application is keen to retrieve all tuples from the cache matching the query.

Region coalescing and region replacement. The semantic intersection gives a new extension to the coalescing strategy. The strategy can coalesce the query and a region if only their unified formula is a conjunction. For instance, it can coalesce query a ANd b and the region a ANd NOt b in one region. Such operation can be done if only three following conditions hold : 1) the region has one term difference, say a1, from the query; 2) symmetrically, the query has one term difference, say a2, from the region; 3) a1 is a negation of a2. Obviously, such a situation can be detected by the same condition (2) and processed afterwards.

The replacement policy, as it was designed for the semantic containment, remains the same for the semantic intersection. When a new query is issued, any semantic region in the cache has its replacement value updated, toward to Vtop, proportionally to the region involvement in the answer.

Second caching technique. The second caching technique disclosed here covers both relations between the query and semantic regions, that is, the semantic containment discussed in Section 3, and the semantic intersection discussed in this section. Moreover, the technique does not distinguish between regions providing the query containment and semantic intersection and process them uniformly to identify those with one-term difference. Caching algorithm 2.

Figures 8(a) to 8(d) illustrate the processing steps for implementing caching according to a second technique. Input: cache with semantic regions and query Q. Output: answer to Q and the cache updated. 1. (First scan) Check the query signature against the region signatures in the cache (step s21). 2. SQ = SR; if there is a region whose formula is equivalent to the query, return the region contents as the answer. Update the replacement value of the region (s23, s24) and stop. 3. SQ INTERSECTION SR= SR: if one or more regions contain the query, choose the region with the minimal cardinality. Scan the region contents and return the tuples matching the query. Update the replacement value of the region and stop.

(Steps s25 to s28). 4. ŠSQ INTERSECTION SRŠ ≥ ŠSRŠ ≥ - k: Identify all regions, say R0, ..., Rm, m ≥ 0, with one-term difference from the query. Return the tuples matching the query in the semantic regions of R0, .., Rm, discarding duplications (steps s29 to s36). Construct the query reminder Qr = Q NOt R0 ... NOt Rk as follows (steps s311 to 315; Fig. 8(b)): Set the query remainder to query Q (step s312). For each region Ri, i=0, .., m, calculate (step s314) the difference ai from the query and constrain the query remainder with NOt ai. Send the query remainder to the server. 5. (Second scan) Scan the region signatures with the condition T (steps s331 to s336; Fig. 8(c)), where T is a choice between ŠSRŠ -2k≤ ŠSR INTERSECTION SQŠ

For each region R fetched, check the Q INTERSECTION R formula intersection (step s332). If the formula is not null, report (step s335) the tuples from the region contents matching the query. 6. When the answer to the query remainder Qr is received (step s34), update the cache as follows (steps s351 to s355; Fig. 8(d)). If regions Ri1, ..., Rip contain the query, replace them with a new region with formula Q. If a region R is complement to query Q and formula R UNION Q is a disjunction, substitute R and Q with a new region. Otherwise, add a new region to the cache with the formula Qr. Update the replacement values for all regions contributed to the partial answer. Example 3.

Figure 9 illustrates region coalescing for the semantic intersection - (a) Queryc ANd d is issued, and (b) after the query.

Assume the cache contains the regions with formulas a ANd b, c ANd d ANd NOt e and the user query is b ANd c; Figure 9(a) shows the regions with their replacement values (assuming Vtop=7) and the query. The first scan detects that the region a ANd b has one-term difference from the query and can constrain the query remainder Qr which is b ANd c ANd NOt a. All tuples from the region contents matching the query give the partial answer. The second scan detects the semantic intersection for region c ANd d ANd NOt e. The region contents is scanned and tuples matching the query complete the partial answer.

Once the answer to the query remainder Qr is received, a new region with the formula c ANd d ANd NOt e is created with the replacement value equal Vtop =8. Also, both a ANd b and c ANd d ANd NOt e have their replacement values updated, proportionally to their contribution to the answer (see Figure 9(b)). Implementation

There is presented hereinbefore a new mechanism for caching Web conjunctive queries, which is designed for use in the system disclosed in J.-M. Andreoli, U. Borghoff, R. Pareschi. Constraint-Based Knowledge Brokers. In Proc. 1st Intl. Symp. on Parallel Symbolic Computation (PASCO'94), Lecture Notes Series in Computing 5, pp 1-11. The mechanism is based on signature files and allows for an efficient reuse of past queries. Two caching algorithms cope with the relations of semantic containment and intersection between a user query and the semantic regions.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值