DYNAMIC QUERY OPTIMIZATION WITH PILOT RUNS
First Claim
1. A computer-implemented method, comprising:
- selecting one or more sub-expressions of a query during compile time;
performing, by one or more computer processors, one or more pilot runs, comprising a pilot run associated with each of one or more of the selected sub-expressions, wherein each pilot run comprises at least partial execution of the associated selected sub-expression, and wherein the pilot runs are performed during execution time;
collecting statistics on the one or more pilot runs during performance of the one or more pilot runs; and
optimizing the query based at least in part on the statistics collected during the one or more pilot runs, wherein the optimization comprises basing cardinality and cost estimates on the statistics collected during the pilot runs.
1 Assignment
0 Petitions
Accused Products
Abstract
In one embodiment, a computer-implemented method includes selecting one or more sub-expressions of a query during compile time. One or more pilot runs are performed by one or more computer processors. The one or more pilot runs include a pilot run associated with each of one or more of the selected sub-expressions, and each pilot run includes at least partial execution of the associated selected sub-expression. The pilot runs are performed during execution time. Statistics are collected on the one or more pilot runs during performance of the one or more pilot runs. The query is optimized based at least in part on the statistics collected during the one or more pilot runs, where the optimization includes basing cardinality and cost estimates on the statistics collected during the pilot runs.
-
Citations
20 Claims
-
1. A computer-implemented method, comprising:
-
selecting one or more sub-expressions of a query during compile time; performing, by one or more computer processors, one or more pilot runs, comprising a pilot run associated with each of one or more of the selected sub-expressions, wherein each pilot run comprises at least partial execution of the associated selected sub-expression, and wherein the pilot runs are performed during execution time; collecting statistics on the one or more pilot runs during performance of the one or more pilot runs; and optimizing the query based at least in part on the statistics collected during the one or more pilot runs, wherein the optimization comprises basing cardinality and cost estimates on the statistics collected during the pilot runs. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A system comprising:
-
a pilot-run unit configured to; select one or more sub-expressions of a query during compile time; and perform, by one or more computer processors, one or more pilot runs, comprising a pilot run associated with each of one or more of the selected sub-expressions, wherein each pilot run comprises at least partial execution of the associated selected sub-expression, and wherein the pilot runs are performed during execution time; a statistics unit configured to collect statistics on the one or more pilot runs during performance of the one or more pilot runs; and a cost-based optimizer configured to optimize the query based at least in part on the statistics collected during the one or more pilot runs, wherein the optimization comprises basing cardinality and cost estimates on the statistics collected during the pilot runs. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A computer program product for optimizing a query, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:
-
selecting one or more sub-expressions of a query during compile time; performing one or more pilot runs, comprising a pilot run associated with each of one or more of the selected sub-expressions, wherein each pilot run comprises at least partial execution of the associated selected sub-expression, and, wherein the pilot runs are performed during execution time; collecting statistics on the one or more pilot runs during performance of the one or more pilot runs; and optimizing the query based at least in part on the statistics collected during the one or more pilot runs, wherein the optimization comprises basing cardinality and cost estimates on the statistics collected during the pilot runs. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification