Auto-tuning SQL statements
First Claim
Patent Images
1. A computer implemented method, comprising:
- using at least one computer system configured for;
receiving a database query language statement and performance information related to the database query language statement;
determining whether one or more statistics relating to the database query language statement are available or accurate in the performance information;
determining a hint for a missing or an inaccurate statistic in the performance information;
creating or improving an estimate of a value of an execution of the query language statement by at least recursively determining whether a predicate selectivity exceeds a threshold, whereinthe act of creating or improving the estimate comprises sampling an adjustable portion of data against which the query language statement is to be performed without requiring performance of a full table scan based at least in part upon a relationship between the predicate selectivity and the threshold; and
verifying the estimate by executing the query language statement to perform at least the full table scan based at least in part upon the predicate selectivity, wherein the act of verifying the estimate performs a sample of a result of the full table scan to adjust the estimate.
1 Assignment
0 Petitions
Accused Products
Abstract
Auto-tuning can be performed by receiving a database query language statement and performance information related to the statement, determining whether one or more performance statistics of the statement are available or missing in the performance information, and determining an auto-tuning hint for each missing statistic.
-
Citations
44 Claims
-
1. A computer implemented method, comprising:
-
using at least one computer system configured for; receiving a database query language statement and performance information related to the database query language statement; determining whether one or more statistics relating to the database query language statement are available or accurate in the performance information; determining a hint for a missing or an inaccurate statistic in the performance information; creating or improving an estimate of a value of an execution of the query language statement by at least recursively determining whether a predicate selectivity exceeds a threshold, wherein the act of creating or improving the estimate comprises sampling an adjustable portion of data against which the query language statement is to be performed without requiring performance of a full table scan based at least in part upon a relationship between the predicate selectivity and the threshold; and verifying the estimate by executing the query language statement to perform at least the full table scan based at least in part upon the predicate selectivity, wherein the act of verifying the estimate performs a sample of a result of the full table scan to adjust the estimate. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 43, 44)
-
-
21. An apparatus, comprising:
-
at least one computer system configured for; receiving a database query language statement and performance information related to the database query language statement; determining whether one or more statistics relating to the database query language statement are available or accurate in the performance information; determining a hint for a missing or an inaccurate statistic in the performance information; and creating or improving an estimate of a value of an execution of the query language statement by at least recursively determining whether a predicate selectivity exceeds a threshold, wherein the act of creating or improving the estimate comprises sampling an adjustable portion of data against which the query language statement is to be performed without requiring performance of a full table scan based at least in part upon a relationship between the predicate selectivity and the threshold; and verifying the estimate by executing the query language statement to generate the hint to perform at least the full table scan based at least in part upon the predicate selectivity, wherein the act of verifying the estimate performs a sample of a result of the full table scan to adjust the estimate. - View Dependent Claims (22, 23, 24, 25, 26)
-
-
27. A volatile or non-volatile computer readable storage medium storing a computer program of instructions, which, when executed by a computer system, cause the computer system to perform a method, the method comprising:
-
receiving a database query language statement and performance information related to the database query language statement; determining whether one or more statistics relating to the database query language statement are available or accurate in the performance information; determining a hint for a missing or an inaccurate statistic in the performance information; and creating or improving an estimate of a value of an execution of the query language statement by at least recursively determining whether a predicate selectivity exceeds a threshold, wherein the act of creating or improving the estimate comprises sampling an adjustable portion of data against which the query language statement is to be performed without requiring performance of a full table scan based at least in part upon a relationship between the predicate selectivity and the threshold; and verifying the estimate by recursively executing the query language statement to generate the hint to adjust at least the adjustable portion of the data by performing at least the full table scan based at least in part upon the predicate selectivity, wherein the act of verifying the estimate performs a sample of the full table scan to adjust the estimate. - View Dependent Claims (28, 29, 30, 31, 32, 33)
-
-
34. A computer implemented method, comprising:
using at least one computer system configured for; receiving a SQL statement for a database for compilation, at an auto tuning optimizer and performance information related to the SQL statement; and determining whether one or more statistics relating to the SQL statement are available or accurate in the performance information; determining a hint for a missing or an inaccurate statistic in the performance information; creating or improving an estimate of a value determined by the auto-tuning optimizer for generating an execution plan by sampling an adjustable portion of data of the database without requiring performance of a full table scan and by using a hint based at least in part upon a recursive determination of a relationship between a predicate selectivity and a threshold or a determination of whether an index for the SQL statement exists; and verifying the estimate by executing the SQL statement to perform at least the full table scan based at least in part upon the predicate selectivity, wherein the act of verifying the estimate performs a sample of a result of the full table scan to adjust the estimate. - View Dependent Claims (35, 36, 37, 38, 39, 40, 41, 42)
Specification