US2012109992A1PendingUtilityA1

Query Rewrite With Auxiliary Attributes In Query Processing Operations

Assignee: CHANG YUAN-CHIPriority: Sep 23, 2003Filed: Jan 9, 2012Published: May 3, 2012
Est. expirySep 23, 2023(expired)· nominal 20-yr term from priority
Y10S707/99935Y10S707/99934G06F 16/24534Y10S707/99932Y10S707/99933
40
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

Techniques are provided for rewriting queries during a database query processing operation to include auxiliary attributes not included in the original query, thus improving processing efficiency. For example, a technique for rewriting a query in a query processing operation includes the following steps. The query is processed in accordance with at least a portion of a data set, producing query results. Data attributes from the query results are analyzed. At least one new predicate from at least one auxiliary data attribute is appended on the query.

Claims

exact text as granted — not AI-modified
1 . Apparatus for rewriting a query during a database query processing operation, comprising:
 a memory; and   at least one processor coupled to the memory and operative to: (i) produce query results comprising one or more target attributes and one or more auxiliary attributes by executing the query on at least a portion of a data set, wherein the one or more target attributes are included in the query and the one or more auxiliary attributes are not included in the query; (ii) determine a relative selectivity for the one or more auxiliary attributes by comparing the query results to at least the portion of the data set from which the query results were produced; and (iii) append the query with at least one new predicate corresponding to at least one of the one or more auxiliary attributes having a high relative selectivity to form a rewritten query.   
     
     
         2 . The apparatus of  claim 1 , wherein the query results are produced by executing the query on records sampled from the data set. 
     
     
         3 . The apparatus of  claim 2 , wherein the processor is further operative to sample the records from the data set. 
     
     
         4 . The apparatus of  claim 3 , wherein the operation of sampling the records comprises sampling every Nth record from the data set, wherein N is a positive integer greater than or equal to two. 
     
     
         5 . The apparatus of  claim 2 , wherein the at least one processor is further operative to execute the rewritten query on the data set from which the records were sampled. 
     
     
         6 . The apparatus of  claim 1 , wherein the operation of comparing the query results to at least the portion of the data set comprises:
 extracting statistics for the one or more auxiliary attributes from the query results;   extracting statistics for the one or more auxiliary attributes from at least the portion of the data set; and   evaluating the relative selectivity for the one or more auxiliary attributes by comparing the extracted statistics from the query results to the extracted statistics from at least the portion of the data set.   
     
     
         7 . The apparatus of  claim 1 , wherein the operation of determining the relative selectivity comprises:
 comparing a range of values in the query results for a given one of the one or more auxiliary attributes to a range of values in at least the portion of the data set for the given one of the one or more auxiliary attributes.   
     
     
         8 . The apparatus of  claim 7 , wherein the operation of determining the relative selectivity further comprises comparing a ratio of the ranges to a predetermined value. 
     
     
         9 . The apparatus of  claim 1 , wherein the operation of appending the query with at least one new predicate comprises:
 selecting at least one auxiliary data attribute with a high relative selectivity;   forming at least one new predicate corresponding to the selected at least one auxiliary attribute; and   appending the query with the at least one new predicate.   
     
     
         10 . The apparatus of  claim 1 , wherein the at least one processor is further operative to execute the rewritten query on the data set. 
     
     
         11 . The apparatus of  claim 1 , wherein the operation of appending the query with at least one new predicate comprises:
 selecting the at least one of the one or more auxiliary attributes based at least in part on a ranking of the determined relative selectivity for the one or more auxiliary attributes; and   appending the query with at least one new predicate corresponding to the selected at least one of the one or more auxiliary attributes to form the rewritten query.   
     
     
         12 . A method for rewriting a query during a database query processing operation, comprising the steps of:
 producing query results comprising one or more target attributes and one or more auxiliary attributes by executing the query on at least a portion of a data set, wherein the one or more target attributes are included in the query and the one or more auxiliary attributes are not included in the query;   determining a relative selectivity for the one or more attributes by comparing the query results to at least the portion of the data set from which the query results were produced; and   appending the query with at least one new predicate corresponding to at least one of the one or more auxiliary attributes having a high relative selectivity to form a rewritten query.   
     
     
         13 . The method of  claim 12 , wherein the query results are produced by executing the query on records sampled from the data set. 
     
     
         14 . The method of  claim 13 , further comprising the step of sampling the records from the data set. 
     
     
         15 . The method of  claim 14 , wherein the step of sampling the records comprises sampling every Nth record from the data set, wherein N is a positive integer greater than or equal to two. 
     
     
         16 . The method of  claim 12 , wherein the step of comparing the query results to at least the portion of the data set comprises:
 extracting statistics for the one or more auxiliary attributes from the query results;   extracting statistics for the one or more auxiliary attributes from at least the portion of the data set; and   evaluating the relative selectivity for the one or more auxiliary attributes by comparing the extracted statistics from the query results to the extracted statistics from at least the portion of the data set.   
     
     
         17 . The method of  claim 12 , wherein the step of determining the relative selectivity comprises:
 comparing a range of values in the query results for a given one of the one or more auxiliary attributes to a range of values in at least the portion of the data set for the given one of the one or more auxiliary attributes; and   comparing a ratio of the ranges to a predetermined value.   
     
     
         18 . The method of  claim 12 , further comprising the step of executing the rewritten query on the data set. 
     
     
         19 . The method of  claim 12 , wherein the step of appending the query with at least one new predicate comprises:
 selecting at least one of the one or more auxiliary attributes based at least in part on a ranking of the determined relative selectivity for the one or more auxiliary attributes; and   appending the query with at least one new predicate corresponding to the selected at least one of the one or more auxiliary attributes to form the rewritten query.   
     
     
         20 . An article of manufacture for rewriting a query during a database query processing operation; comprising a machine readable storage medium containing one or more programs which when executed implement the steps of:
 producing query results comprising one or more target attributes and one or more auxiliary attributes by executing the query on at least a portion of the data set, wherein the one or more target attributes are included in the query and the one or more auxiliary attributes are not included in the query;   determining a relative selectivity for the one or more auxiliary attributes by comparing the query results to at least the portion of the data set from which the query results were produced; and   appending the query with at least one new predicate corresponding to at least one of the one or more auxiliary attributes having a high relative selectivity to form a rewritten query.

Join the waitlist — get patent alerts

Track US2012109992A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.