Detecting and processing cache hits for queries with aggregates
First Claim
1. A non-transitory computer-usable storage medium storing instructions executable by a processor, said instructions comprising:
- a first set of instructions configured to maintain a select list index of a plurality of cached queries, whereinsaid select list index comprises key field entries and data item field entries,said select list index stores one or more unique items,each of said one or more unique items is extracted from a clause of a statement of at least one cached query of said plurality of cached queries,said plurality of cached queries are stored in a cache,each key field entry stores a unique item of said one or more unique items,said each key field entry is associated with a corresponding data item field entry of said data item field entries,said corresponding data item field entry is configured to store information identifying said at least one cached query that comprises said unique item stored in said each key field entry, andat least one of said one or more unique items comprises a precomputed aggregate from a previously cached query; and
a second set of instructions configured to determine a list of candidate queries configured to be used to answer a new query that includes at least a first unique item and a second unique item, whereinthe list of candidate queries is determined based on an intersection of a first set of cached queries that include the first unique item and a second set of cached queries that include the second unique item.
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
20 Claims
-
1. A non-transitory computer-usable storage medium storing instructions executable by a processor, said instructions comprising:
-
a first set of instructions configured to maintain a select list index of a plurality of cached queries, wherein said select list index comprises key field entries and data item field entries, said select list index stores one or more unique items, each of said one or more unique items is extracted from a clause of a statement of at least one cached query of said plurality of cached queries, said plurality of cached queries are stored in a cache, each key field entry stores a unique item of said one or more unique items, said each key field entry is associated with a corresponding data item field entry of said data item field entries, said corresponding data item field entry is configured to store information identifying said at least one cached query that comprises said unique item stored in said each key field entry, and at least one of said one or more unique items comprises a precomputed aggregate from a previously cached query; and a second set of instructions configured to determine a list of candidate queries configured to be used to answer a new query that includes at least a first unique item and a second unique item, wherein the list of candidate queries is determined based on an intersection of a first set of cached queries that include the first unique item and a second set of cached queries that include the second unique item. - View Dependent Claims (2, 3, 8, 9, 10, 20)
-
-
4. A non-transitory computer-usable storage medium storing instructions executable by a processor, said instructions comprising:
-
a first set of instructions configured to maintain an index of a plurality of aggregates, wherein said index comprises key field entries and data item field entries, said index stores one or more unique items comprising a precomputed aggregate from a previously cached query, each of said one or more unique items is aggregated upon by one or more aggregates extracted from a clause of a statement of at least one cached query of a plurality of cached queries, said plurality of cached queries are stored in a cache, and each key field entry stores a unique item of said one or more unique items, said each key field entry is associated with a corresponding data item field entry of said data item field entries, said corresponding data item field entry is configured to store information identifying said one or more aggregates that operate upon said unique item, wherein said one or more aggregates are drawn from a select list index; and a second set of instructions configured to access said index and rewrite a selected aggregate in a new query, said second set of instructions is configured to rewrite said selected aggregate only if an exact match for said selected aggregate cannot be found in said select list index. - View Dependent Claims (5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
Specification