Detecting and processing cache hits for queries with aggregates
First Claim
1. A computer program product operative to support query caching, comprising a computer-usable medium having embodied therein computer-readable program codes for determining a list of candidate queries stored in a cache that potentially could be used to answer a new query;
- and evaluating each of at least one candidate query in the list to determine whether or not there is a cache hit for the candidate query, the cache hit indicating that the candidate query could be used to answer the new query, wherein the evaluating is performed using a set of rules that allows for inexact matches of aggregates, if any, included in the new query.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques to improve query caching performance by efficiently selecting queries stored in a cache for evaluation and increasing the cache hit rate by allowing for inexact matches. A list of candidate queries stored in the cache that potentially could be used to answer a new query is first determined. This list may include all cached queries, cached queries containing exact matches for select list items, or cached queries containing exact and/or inexact matches. Each of at least one candidate query is then evaluated to determine whether or not there is a cache hit, which indicates that the candidate query could be used to answer the new query. The evaluation is performed using a set of rules that allows for inexact matches of aggregates, if any, in the new query. A query plan is generated for the new query based on a specific candidate query with a cache hit.
-
Citations
25 Claims
-
1. A computer program product operative to support query caching, comprising a computer-usable medium having embodied therein computer-readable program codes for
determining a list of candidate queries stored in a cache that potentially could be used to answer a new query; - and
evaluating each of at least one candidate query in the list to determine whether or not there is a cache hit for the candidate query, the cache hit indicating that the candidate query could be used to answer the new query, wherein the evaluating is performed using a set of rules that allows for inexact matches of aggregates, if any, included in the new query. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
- and
-
18. A computer program product comprising a computer-usable medium having embodied therein computer-readable program codes for maintaining a data structure used to support query caching, the data structure including
a key field for storing unique items in one or more clauses of statements used for queries stored in a cache, wherein the unique items include aggregates; - and
a data item field for storing information indicative of which cached queries include the unique items in the key field in their statements, and wherein the data structure is accessed to determine a list of candidate queries from among the queries stored in the cache that potentially could be used to answer a new query, and wherein the aggregates in the key field are usable for performing aggregate roll-up. - View Dependent Claims (19, 20)
- and
-
21. A computer program product comprising a computer-usable medium having embodied therein computer-readable program codes for maintaining a data structure used to support query caching, the data structure including
a key field for storing unique items being aggregated by aggregates in queries stored in a cache; - and
a data item field for storing aggregates that operate on the unique items in the key field, and wherein the data structure is accessed to rewrite an aggregate in a new query based on aggregates in the cached queries. - View Dependent Claims (22, 23)
- and
-
24. In a computer system, a method for supporting query caching, comprising:
-
determining a list of candidate queries stored in a cache that potentially could be used to answer a new query; and
evaluating each of at least one candidate query in the list to determine whether or not there is a cache hit for the candidate query, the cache hit indicating that the candidate query could be used to answer the new query, wherein the evaluating is performed using a set of rules to allow for inexact matches of aggregates, if any, included in the new query. - View Dependent Claims (25)
-
Specification